Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In my script I have an interval. Interval(DateTime2 - DateTime1,'mm') as MyInterval to get the minutes between two date times.
This returns the expected value.
If I select just one record, the interval is 63
Sum(MyInterval) = 63 Count(MyInterval)=1 Median(MyInterval) = 63 which is correct.
However avg(MyInterval) = 0.044131944
Why is this output for the average function and how do I have it return the average of my value.
In Qlik, times are represented as the fraction of a day. 0.5 = noon. So 044131944 * 1440 minutes in a day = 63 minutes. Avg is returning the correct value. You just need to apply the Interval formatting function if you want to see it as minutes
Interval(avg(MyInterval), 'mm')
-Rob
In Qlik, times are represented as the fraction of a day. 0.5 = noon. So 044131944 * 1440 minutes in a day = 63 minutes. Avg is returning the correct value. You just need to apply the Interval formatting function if you want to see it as minutes
Interval(avg(MyInterval), 'mm')
-Rob