Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have coupon codes information along with their start dates and end dates in separate columns. The three fields are coupon code, start date, end date. I want to create a calendar where if a user selects a particular date or a date range, all the coupon codes which have at-least 1 day of the selected range in between the start date and end date should be selected. Anyone knows how to do this?
You can create a new field called - date which contains all date values (start & end date) and then use this field as a calendar and store in a variable the max and min date (based on user selection) and add it in Set-Analysis
variables:
let vMaxDate =Max(date);
let vMidDate =Mid(date);
coupon_date:
Load * Inline [
couponcode, startdate, enddate
1 ,01/01/2022,01/02/2022
2 ,01/01/2022,01/05/2022
3 ,01/03/2022,01/31/2022
4 ,01/01/2022,01/14/2022
5 ,01/23/2022,01/25/2022
6 ,01/05/2022,01/20/2022
];
Load startdate as date Resident coupon_date;
Load enddate as date Resident coupon_date;
Expression:
Only({=$(vMinDate)"}>}startdate)
Only({=$(vMinDate)"}>}enddate)
Hey, I understood the idea but there is something wrong with the expression to be used as dimensions in the table. Can you check and rewrite them once.