Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
nezuko_kamado
Creator
Creator

How to calculate number of days in the date range selection from Date Picker?

I want to calculate the number of days selected from Date picker, like how many week days during the time range, and how many weekend or holidays in during the time range.  Is this possible?

nezuko_kamado_0-1621021751509.png

nezuko_kamado_3-1621021990366.png

 

1 Reply
Gysbert_Wassenaar

Perhaps like this:

Number of days in the range : count(distinct MyDateFieldHere)

Numner of weeks: the above divided by seven

Number of weekends: count({<MyDateFieldHere={"=WeekDay(MyDateFieldHere)>5"}>}distinct MyDateFieldHere)

Number of Holidays: for that you need to specify which days should be counted as holidays. The best solution is to do this in the load script by creating a Calendar dimension. Here's an example: https://community.qlik.com/t5/Documents/Master-Calendar-with-Working-days-Holidays-Flag/ta-p/1494162


talk is cheap, supply exceeds demand