Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have one scenario .
Daily collections by centers (daily summary from previous day 5PM to today 5PM).
For example 10-04-2018 : 5PM to 11-04-2018 5PM is 11-04-2018 .
And also if it is sunday, 5PM to 1PM.
This is our day calcluation.How can i write the script to get this scenario.Can anyone help me.
Thanks.
The Daystart() function comes in very handy as you can calculate a new date which has an offset from the given date.
LOAD
RegisteredDate,
Value,
DayStart( RegisteredDate , 0 , -7/24 ) AS SummaryDate
....
Then you can do your sums according to SummaryDate later in the load script or in a sheet in the application.
When it comes to Sundays - does it really matter that the day ends at 1PM? Will you have values occuring between 1PM and 5PM anyway? If you do how would you consider these values - where would they belong when it comes to a SummaryDate?
Try this,
timestamp(time_H+0.25) as time
The Daystart() function comes in very handy as you can calculate a new date which has an offset from the given date.
LOAD
RegisteredDate,
Value,
DayStart( RegisteredDate , 0 , -7/24 ) AS SummaryDate
....
Then you can do your sums according to SummaryDate later in the load script or in a sheet in the application.
When it comes to Sundays - does it really matter that the day ends at 1PM? Will you have values occuring between 1PM and 5PM anyway? If you do how would you consider these values - where would they belong when it comes to a SummaryDate?
Thanks a million.
and yes I will have values b/w 1PM and 5PM