Skip to main content
Announcements
See why Qlik was named a Leader in the 2025 Gartner® Magic Quadrant™ for Augmented Data Quality Solutions: GET THE REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Asinghal04
Contributor II

Calculating the delay in 2 dates

Hi everyone,

 

can someone help me with creating this measure:-

"Create a measure which calculates the average day of delay between min(D1, Gx) and the D2. (where D1, Gx and D2 are fields created as Calenders, and D2 is the deadline)

For example take D1 = 15 May, 2021, Gx = 18 May, 2021,  D2 = 10 May, 2021, expected result =  5 days

another example D1 = 12 Aug, 2021, Gx = 10 Aug, 2021, D2 = 20 Sept, 2021, expected results = - 41 days (as there is no delay)

Thanks,

AS

Labels (1)
5 Replies
JuanGerardo
Partner - Specialist

Hi @Asinghal04 , you can try:

RangeMin(D2 - D1, D2 - Gx)

or

D2 - RangeMin(D1, Gx)

 

JG

Asinghal04
Contributor II
Author

Hi Juan,

It does not work, could it probably be because they are dates?

AS

JuanGerardo
Partner - Specialist

Dates work, for example:

RangeMin(MakeDate(2021, 5, 1), MakeDate(2021, 6, 11), MakeDate(2021, 3, 3))

will return 03/03/2021. Maybe you are not using correct variables or fields?

Asinghal04
Contributor II
Author

if you will check the question the examples are in the format

05- mar - 2021 instead of 05 - 05- 2021

Do you think it is because of it?

a small correction all the entered field are created as calender

JuanGerardo
Partner - Specialist

Maybe you have to use Date(D1), Date(D2), etc. to be used as date. I think your problem is not with the RangeMin() function, but with the date conversions. If you have some text code, for example using an INLINE, it could be easier.

JG