Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

mp802377
Contributor

Summing duration / slider not working

Hello,

I originally had this formula in script editor

// Time(num(time#(DDURATION, 'hh:mm')) + num(time#(RDURATION, 'hh:mm')) , 'hh:mm') as JourneyTime,

But then I realized if the duration went over 24 hours it would not calculate correctly. So if one duration was 15:30 and the other was 12:45 minutes it would look at is as 3:15 hours instead of 28:15

There are two sliders each with a variable (they wanted sliders). One variable as vStartJourneyTime and the other slider with vEndJourneyTime. Both are showing Number as Interval hh:mm. This worked until we noticed it was calculating total duration in hours. In the script I changed it to this:

interval(Time((DDURATION+RDURATION),'hh:mm'),'mm')  AS JourneyTime,

But now the sliders are not working when working with the chart. This was the original expression in the chart:

=Interval(Avg({$<JourneyTime={'>=$(vStartJourneyTime)<=$(vEndJourneyTime)'}>}JourneyTime),'h:mm')

It will work without the set analysis statement

=Interval(Avg(JourneyTime),'h:mm')

What am I missing?

Thank you,

Martha

1 Solution

Accepted Solutions

Re: Summing duration / slider not working

May be this

=Interval(Avg({$<JourneyTime={">=$(=Interval(vStartJourneyTime, 'mm'))<=$(=Interval(vEndJourneyTime, 'mm'))"}>} JourneyTime),'h:mm')

2 Replies

Re: Summing duration / slider not working

May be this

=Interval(Avg({$<JourneyTime={">=$(=Interval(vStartJourneyTime, 'mm'))<=$(=Interval(vEndJourneyTime, 'mm'))"}>} JourneyTime),'h:mm')

mp802377
Contributor

Re: Summing duration / slider not working

Thank you so much! That worked!

Community Browser