Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
anseglko
Creator
Creator

Max value from running total graph

I have a line graph with timestamp as a dimension and population as a measure. The measure is calculated with

rangesum(above(sum(if(floor=1,people_in-people_out)),0,rowno()))
/count(distinct entry_date)

It sums all the people coming in and subtracts people going out. This is divided by all days to get the daily average (there might be a better way to do this too)

The graph is correct and looks like this:

1.png

I need to show the maximum value of the day in a KPI, so in this case 278. How is this done? 

Labels (5)
1 Solution

Accepted Solutions
anseglko
Creator
Creator
Author

I revisited this problem and finally found a solution that works

=Max(Aggr(rangesum(above(Sum(if(floor=1,people_in-people_out)),0,rowno()))
/count(distinct entry_date),(entry_hour,(NUMERIC))))

I had tried max aggr before but now it finally worked with the (NUMERIC) added.

View solution in original post

2 Replies
jheasley
Luminary Alumni
Luminary Alumni

try a max(aggr(YOUR ORIGINAL EXPRESSION HERE))

anseglko
Creator
Creator
Author

I revisited this problem and finally found a solution that works

=Max(Aggr(rangesum(above(Sum(if(floor=1,people_in-people_out)),0,rowno()))
/count(distinct entry_date),(entry_hour,(NUMERIC))))

I had tried max aggr before but now it finally worked with the (NUMERIC) added.