Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Max Value with Time Intervals

Hi guys im find something that should be fairly straightforward to be causing some issues.

I am trying to get the max value of a sum of a time interval from the following table.

Categorysum(TimeTaken)
A55:50:00
B2:22:00
C18:00:00
D4:26:00
E0:58:00
F451:56:00
G7:19:00
H35:39:00
I28:45:00
J23:28:00
K6:12:00
L61:13:00
M28:27:00
N0:40:00

The value im expecting should be 451:56:00.

What I want to achieve is to set a "Static Max" value of a Y axis on a Chart table, reason is that I have one chart over the other, one of the charts is transparent and the user changes and filters values the Chart moves around on the max values.

So With this I would hope that I always have both charts showing the max possible value and thus they are always showing correct values.

Many Thanks

3 Replies
tresesco
MVP
MVP

Try like:

=Max(Aggr(sum({1}TimeTaken),Category))   // {1} makes it selection irrespective thus making it static.

Not applicable
Author

That does work, but the problem is now that if the user selects 2 or 3 months the chart bars become very small due to the scale of the whole chart.

Strangely if I replace the ignore selections os the set analysis with a $ it does not give me the correct value for my selections.

Confused.

Not applicable
Author

Ok it was under my nose all along, the correct is

=interval(max(aggr(sum(interval(TimeTaken,'hh:mm')), Category)),'hh:mm')