Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to pull in 18 full months of data on a rolling basis. I do not want any partial months except for the current month. How would I accomplish this?
I experimented with the following let statements with no luck
LET vStartDate = (TODAY-547);
LET v18MonthsAgo = DATE(Month(vStartDate)-01-year(vStartDate));
***
Load DATE("DATE_CHANGED", 'MM/DD/YYYY') as DateChanged;
FROM MyTable
WHERE "DATE_CHANGED" > '$(v18MonthsAgo)'
May be this
LET vStartDate = Num(MonthStart(Today(), -18));
Load DATE("DATE_CHANGED", 'MM/DD/YYYY') as DateChanged;
FROM MyTable
WHERE "DATE_CHANGED" > '$(vStartDate)'
I get error message "Conversion failed when converting date and/or time from character string"
Can you share a screenshot of the error message
Try this
LET vStartDate = Date(MonthStart(Today(), -18), 'DDMMMYYYY');
Load DATE("DATE_CHANGED", 'MM/DD/YYYY') as DateChanged;
FROM MyTable
WHERE "DATE_CHANGED" > '$(vStartDate)'
As far as I can tell, this worked! Thank you for your help and quick responses!