Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pjpkumar26
Contributor III
Contributor III

how to get Average of 7 days using aggr function

Hello All,

I got Date and User count on a weekly basis:

requirement:

pjpkumar26_0-1663321320661.png

I need a new column where it shows average on a weekly basis  

Advance Thanks,

Kumar

 

3 Replies
martinpohl
Partner - Master
Partner - Master

Hi,

use

rangeavg(above(sum(Count),0,7))

as expression

Regards

rubenmarin

Hi, usually (one of the uses of) aggr is used when you want to use calculation that splits a row in many subcalculations, like if for each date you want to calculate the average by hour, hour is not on the table, but you want to calcualte each hour separatedly, do the average and show in the table by date.

To merge different rows in one you an use total to go outside the dimension value, and in this case you can also use above to go to the last 6 rows, and a Rangeavg to get the average of all different values, so maybe this can work:

RangeAvg(Above(TOTAL [YourCountExpression],0,6))

pjpkumar26
Contributor III
Contributor III
Author

Thanks for your reply - That worked