Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Matching Interval With Interval

I'm trying to match two date ranges and then count the number of days that overlap from one to another. Both intervals reside in a same table. For example, I'm trying to calculate number of DaysDiscounted:

FromActualDate     ToActualDate     FromDiscountDate     ToDiscountDate     DaysDiscounted

3/24/2013               4/6/2013           4/1/2013                    4/10/2013              6

4/7/2013                 4/20/2013         4/1/2013                    4/10/2013              4

3/24/2013               4/6/2013           4/1/2013                    4/5/2013                5

I could implenet manual logic something like a calculated field like:

=if(ToDiscountDate > ToActualDate, (ToDiscountDate - ToActualDate)+1,(ToActualDate - FromDiscountDate)+1)

but it does not work in all Cases, wondering if QlikView provides more effiecient way, similar to IntervalMatch.

Any suggestions?

0 Replies