Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How count work day in a month include saturday?

The example, if i start work from the start month 1 Feb 2012, today is 20 Feb 2012. How do i can count the networkday if i want to include Saturday as a networkday. The Result is 17.

How to make the code expression if i want to get this result?

Thanks,

Danny H

2 Replies
Not applicable
Author

This is the true code :

Count({<TRX_DATE_TRX={">=$(=vStartDate)<=$(=vLastDate)"}, WEEKDAY_TRX={'*'} - {'Sun'}>} TRX_DATE_TRX) -

Count({<TRX_DATE_TRX={">=$(=vStartDate)<=$(=Date(Now()))"}, WEEKDAY_TRX={'*'} - {'Sun'}>} TRX_DATE_TRX)

jagan
Partner - Champion III
Partner - Champion III

Hi,

Arrive a flag which specifies whether the date is a working day or not.  Please check this script

LOAD

     TRX_DATE_TRX,

     If(TRX_DATE_TRX = 'Sun', 0, 1) AS IsWorkDay

     '

     '

FROM DataSource;

Now in expression you can simply calculate the work days by

=Sum({<TRX_DATE_TRX={">=$(=vStartDate)<=$(=vLastDate)"} IsWorkDay >)

Also one suggestion never use Now() in expressions it decreases the performance, instead use Today().

Hope this helps you.

Regards,

Jagan.