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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Battistella
Contributor
Contributor

Counting Days in specific range

Hello,

I am creating a tool that counts days within a specific range of time.

I have a database of people who took a leave of abscence from work, for example:

Battistella_0-1646317911875.png

See that I have a lot of short periods of time, and I need to filter a specific range such as:

(format being: dd/MM/yyyy)

Battistella_1-1646318017025.png

The problem is there are some periods of time that begins before that range, but ends between it, or that starts between and ends after. Therefore my counter is adding the full days. For example:

John  took a leave of abscense from  o5/03/2021 to 25/03/2021 

I need to see how many days off he was from 15/03/2021 to 15/04/2021

It is suppose to be =10, but it is resulting 30.

I don't know if i could explain my problem, any doubts just ask me. 

Thank you all

Labels (1)
1 Reply
hic
Former Employee
Former Employee

You need to generate all dates in the range, and then just use 

Count(ReferenceDate)

as measure. See more on https://community.qlik.com/t5/Qlik-Design-Blog/Creating-Reference-Dates-for-Intervals/ba-p/1463944