Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Frank_Hartmann
Master II
Master II

moving average

Hallo QV Community

I use the following formula in the chart for accounting the moving average:

Rangesum(above(Y,0,Row())/Row()

mAvg.png

Is there any possibility to export the last value (=9) of the Rangesum formula to a textbox?

I tried to use the Rangesum formula within a textbox but it doesnt work for specific month.

The reason why i want to get this value to a textbox is because i need the value exported per macro to a powerpoint

document as picture or  as object.

any ideas?

thanks for your help

1 Solution

Accepted Solutions
giakoum
Partner - Master II
Partner - Master II

FirstSortedValue(aggr(rangesum(above(y,0,Rowno()))/RowNo(),y), -x)



View solution in original post

6 Replies
giakoum
Partner - Master II
Partner - Master II

try to aggregate over y and take the max, something like :

Rangemax(aggr(rangesum(above(y,0,Rowno())), y))

Frank_Hartmann
Master II
Master II
Author

thank you for your tip. the following formula works for me

max(aggr(rangesum(above(y,0,Rowno()))/RowNo(), y))

But what if the actual value is not the max value? then the value will not be shown in the textbox.

any ideas?

giakoum
Partner - Master II
Partner - Master II

add firstsortedvalue function in the expression based on x axis instead of rangemax

Frank_Hartmann
Master II
Master II
Author

ok, now i have:

FirstSortedValue(aggr(rangesum(above(y,0,Rowno()))/RowNo(),y),x)

that gives me the firstvalue (=3), but i need the last value (=9)

what a pitty that there is no lastsortedvalue function in QV

any ideas?

giakoum
Partner - Master II
Partner - Master II

FirstSortedValue(aggr(rangesum(above(y,0,Rowno()))/RowNo(),y), -x)



Frank_Hartmann
Master II
Master II
Author

Thank u very much