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: 
Not applicable

Count day in dynamic interval

I have this data in model:

Date               DateEnd     Flag

01/06/2013     01/09/2013     0

02/09/2013     23/12/2013     1

Date mean DateBegin interval for value of flag.

Now I want calc how many days in selected period (year, month, days, week - anything) in calendar Flag was 1.

Example:

If user selected November: Day for flag is 30.

If selected September: day for flag is 29.

If selected Jule: day for flag is 0.

If selected 01/06/2013 - 23/12/2013: day for flag is 113.

It is possible to calculate in expression?

1 Reply
swuehl
MVP
MVP

So you somewhere have a continuous Date field or calendar the user makes his selection in, right?

You can use INTERVALMATCH LOAD prefix in your script to link your flag periods to this date field (finally, I would probably join the flag to your calenda).

Then, doing your calculation is just summing the Flag value while user selects a Date field period.