Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have to create last seven days flag in script ,instead of today() i have to take max date of my date less than 7 days . Any help.
IF(Date >max(Date)-7,1,0)
Thanks,
You can load the fact table and store the max date into variable.
DateTmp:
Load Max(Date) as MaxDate
resident <your fact table>;
Let vMaxDate = peek('MaxDate',-1,'DateTmp');
NOW
IF(Date >$(vMaxDate )-7,1,0)