Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculation Avg based on difference of rows

Hello All,

I need help from you experts.

I have a table like below

1.JPG

In this table Column 3 is the difference of column1 rows.(Below - Above Row) i.e., ( 0-97 - 0.85  = 0.12 ).

What i need is,  to calculate the average of Column3(sum(Column3) / Count(Column3)) . I have tried many ways. but am not getting proper result.

I have to use this average value in an another formula.

Help me if you people have any idea on this.

Thanks in Advance

4 Replies
swuehl
MVP
MVP

Maybe like attached (for a chart based solution, it might be better to do all this in the script, if you don't need to be selection sensitive)?

Not applicable
Author

Hi Stefan,

Thanks for your help. Yeah, it is good if we give in script level, but in chart only am calculating the difference and i have to calculate the average of this difference value. I don't have column1,column2 n 3 as dimension, All are expressions.

Any way thanks Stefan, for your reply. based on your reply i got an idea.

vincent_ardiet
Specialist
Specialist

Hi,

Have you try to use an aggr function?

For example : avg(aggr(nodistinct Column1-above(total Column1),CommonYear, CommonMonth))

Regards,

Vincent

er_mohit
Master II
Master II

try this

sum(TOTAL Column3)/Count(TOTAL Column3)

see the attached file