I have a need to create a report, where some dates are present in the table,however the requirement is the report should consist of every monday for the entire year irrespective of the data unavailability(it`ll show null for those dates).
How to achieve this logic in Informatica?
you need to use some DB for generate date series. And then join that series with your data to get what you want.
SELECT
(to_date('01-05-2015','DD-MM-YYYY') - level + 1) AS dt
FROM dual
CONNECT BY LEVEL <= (to_date('01-01-2020','DD-MM-YYYY') - to_date('01-01-2040','DD-MM-YYYY') + 1)
I assumed your start date is jan-20 and end date is jan-2040. You can change them if you want to. You need to make sure which date range you want to see in report.
dt = trunc(dt_from pipeline)
Your data should look like -
dt Quantity
05-04-2015 00:00:00 1
04-04-2015 00:00:00
03-04-2015 00:00:00 6
02-04-2015 00:00:00 9
01-04-2015 00:00:00 28
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.