Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I’m working in the Data Load Editor in QLIK Sense. I want limit my data by reviewing two dates.
Booked_Date and Snapshot_Date. The Snapshot_Date is always the first day of the Month
The Booked_Date needs to be 3 months prior to the Snapshot_Date. I’m thinking to subtract the Number of Months between the two dates. If they equal to 3 get the data.
I can’t figure out the Syntax to do this. Below are examples of what I’m working with
Booked_Date | Snapshot_Date | Capture |
04/05/2016 | 07/01/2016 | Yes |
04/15/2016 | 05/01/2016 | No |
12/15/2015 | 03/01/2016 | Yes |
12/15/2015 | 12/01/2015 | No |
Thank you in advance
Bee
I tried this code and I was getting errors and couldn't load the data. So I took your concept and tweeked it to this:
MonthName(AddMonths(Snap_Shot_Dt,-3)) = MonthName(Booked_Dt)
And this works perfect. Thanks for getting me started. I'm learning a lot.
May be like this:
LOAD Booked_Date,
Snapshot_Date,
FROM Source
Where ((Year(Snapshot_Date) * 12) + Month(Snapshot_Date)) - ((Year(Booked_Date) * 12) + Month(Booked_Date)) = 3;
I tried this code and I was getting errors and couldn't load the data. So I took your concept and tweeked it to this:
MonthName(AddMonths(Snap_Shot_Dt,-3)) = MonthName(Booked_Dt)
And this works perfect. Thanks for getting me started. I'm learning a lot.