Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can anyone help in weekly calcualtion as below,
Week Starts Monday at 6:00 am and ends next Monday at 5:59am
There is not much of information given here, but I assume you may want something like
LOAD *,
Weekstart(Daystart(Timestamp, 0, 0.25),0, 0.25) as Weekstart,
Weekday(Timestamp) as WeekDay;
LOAD Timestamp(RAND() + MakeDate(2015, 8)+floor(RAND()*31)) as Timestamp,
RAND() * 100 as Value
autogenerate 1000;
Use Weekstart field to group your Timestamps in your given range, Mo 6:00 AM to next Mo 5:59 AM.
Thanks Swuehl..
I need to calculate work done for each week, but week are consider monday 6.00am to monday 5.59am.
Understood.
Have you tried what I suggested above?
I assume your work done records show a related timestamp, so it should be easy to translate the above sample code to your setting (and if you find it hard to apply to your setting, why don't you post some sample lines of your data?).
can anyone help me in Weekly calculation,
if week starts on 8/24, then i need to calculate number of days for 8/24 6.00 am to 8/31 5.59 am. Pls find attached the highlighted records should not calculated for 8/24 week.
Sure you can find help here, but it would make things a lot easier
- if you give feedback to the suggested solution (see my first post, haven't heard anything from you why this is not working)
- if you post a small sample data record set (like shown in your attached image, but not as image, but as e.g. INLINE table or Excel file)
Again, if you want to group your Date field values into ranges from Mon 6 AM to next Mon 5:59, something like
Weekstart(Daystart(Date, 0, 0.25),0, 0.25) as Weekstart,
in your load script or as calculated dimension should do the grouping.