Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a field : actual_date
Is it possible when loading the data to set a flag against this date if it falls within the last 5 working days upto midnight of last night?
Eg
Data is reloaded at 7am on a Wednesday morning. I would need the 'Last 5 Days Flag' to cover
Many thanks for you help
Tom
Something like this perhaps:
LOAD
actual_date,
if( firstworkday(today()-1, 5) <= actual_date and actual_date < today(), 1, 0) as IsInLast5Days
FROM ...
Something like this perhaps:
LOAD
actual_date,
if( firstworkday(today()-1, 5) <= actual_date and actual_date < today(), 1, 0) as IsInLast5Days
FROM ...
In the load script add something like :
if ( [actual_date] > today() -5 , 1 , 0 ) as [Last5DayFlag] ,
many thanks,
Works perfectly