Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
oxiofrt
Partner - Creator
Partner - Creator

Count the number of crossing dates

Hi,

i have some events with a beginning and an ending date (with hours, minutes, ...)

I would like (without using sql loading or scripts)  to calculate for each event, how many are in progress (counting itself).

For example with 3 events (event, date b

Event       Date begin                         Date end                                    Number of events in progress

A             11/02/2012 08:00:00          11/02/2012 08:30:00                     1

B             11/02/2012 08:10:00          11/02/2012 08:50:00                     2

C             11/02/2012 08:15:00          11/02/2012 08:55:00                     3

D             11/02/2012 08:40:00          11/02/2012 10:00:00                     3

D             11/02/2012 09:00:00          11/02/2012 10:30:00                     2

D             11/02/2012 11:00:00          11/02/2012 12:00:00                     1

I have tried several ways but not of them worked well...

You will find herejoined a test app

Thanks a lot for your help

3 Replies
Gysbert_Wassenaar

See this blog post: Creating Reference Dates for Intervals


talk is cheap, supply exceeds demand
oxiofrt
Partner - Creator
Partner - Creator
Author

Thanks a lot for your answer

However, I would like to create a formula rather than using scripts.

Gysbert_Wassenaar

Good luck with that. You'll have to compare every row in your chart with every other row in your chart. That's a lot of if statements for one expression.


talk is cheap, supply exceeds demand