Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
1) how can i calculated the data excluding only sunday's in a year .
2) how can i calculated the data excluding both saturday and sunday's in a year .
Thanks in advance
1. Make two flags in your load scrip:
If(weekday(Date) = 6, 1, 0) as Flag_Sunday
If(weekday(Date) = 5 or weekday(Date) = 6, 1, 0) as Flag_Saturday_Sunday
And use set analysis in calculations.
2. Or make Weekday field and use it also in set analysis.
In addition to the suggestion from mindaugasbacius you could also reverse the logic by creating a flag for a working day to calculate later directly with the flag without the need of set analysis:
If(weekday(Date) < 5, 1, 0) as Flag_Workingday
and then within your objects: sum(AnyValue*Flag_Workingday)
- Marcus