Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate working days up to Today

I know this is probably really easy for many of you, but i'm stuck!

I have this formula in our script, but I'd like to restrict it to only calculate the YTD working days which doesn't include Today, a Max date of Today()-1.

i can't figure out how to do it.

NetWorkDays(Tempdate_Ord,Tempdate_Ord,$(vHolidayList)) as IsWorkingDay,

5 Replies
nagaiank
Specialist III
Specialist III

Try

NetWorkDays(Tempdate_Ord,Today()-1,$(vHolidayList)) as IsWorkingDay

I assume Tempdate_Ord is a date field and the variable vHolidayList has comma separated list of holiday dates.

Not applicable
Author

Thank you for your reply, that's getting close, but instead of giving me a 1 or 0, it's doing some kind of cumulative calculation. So Jan 2nd = 12, Jan 3 =11, i'm not sure what's causing that. The original expression gave me 0 or 1.

IsYTDWorkingDay.jpg

Not applicable
Author

Does anyone have any ideas as to why the flag is now accumulating with the suggestion Krishnamoorthy suggested? I feel like i'm so close, but just can't figure it out.

any other ideas?

nagaiank
Specialist III
Specialist III

The expression gives the count of working days (excluding holidays) from the first Jan till yesterday. Hope this explains the result and I thought this is what you wanted in your original post.

Not applicable
Author

While I am looking for the calculation to only apply up until yesterday, I would really like the values to simply be 1 or 0, not an accumulation.

Sue