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) Where you want to exclude... Front end or back end?
2) exclude means what here? You don't want to load those records or want to exclude them while doing some calculations?
Hi Anusha,
what do you mean by calculate? in the front end or in the loading script.
There are a lot of ways for achieving this using:
-networkdays
-weekday
-Etc
Please elaborate more in order to be able to help you.
Kind regards,
Hi,
If you want to count no of days in year excluding sunday
then in script create flag to identify sunday
like if(wildmatch(Weekday(datefield),'Sunday'),'weekend','weekday') as flag
and in front end use
count({<flag={'weekday'}>}datefield)
2: If you want to exclude Saturday and Sunday both then use networkday()
Kind Regards
1) how can i calculated the data excluding only sunday's in a year .
* You can create a flag in your master calendar for identifying the Sunday ..like
if(weekday(date_field)='Sun',1,0) as Sunday_flag, while doing the calculation using this flag to eliminate the Sunday values
2) how can i calculated the data excluding both saturday and sunday's in a year .
* you Networkingdays() function it will automatically eliminate the Saturday and Sunday
Backend ..
Hi,
in the script for Exclude Saturday and Sunday.
Load your data in a Temp table and at the end do this :
TBLFACT_TEMP:
noconcatenate LOAD *,
if(weekday(Date)>4,'X') as Weekend //This for identify Saturday and Sunday for only sunday put > 5
RESIDENT TBLFACT;
Drop Table TBLFACT;
TBLFACT:
noconcatenate LOAD *
RESIDENT TBLFACT_TEMP
where Weekend <> 'X';
DROP TABLE TBLFACT_TEMP
Regards,
Emilien
Thanks...
Thanks...