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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Running average

Hello Experts,

I have a question regarding running average. I have a table with Fees by OrderNum and OrderDate.

In the report, I want to see the data by Order Day (1, 2, etc.) and Avg fees and running average.

As you can see in the example below, I have 3 orders for 14th and average for this day 48.33 (45, 45 and 50). But Average of all orders from 10th to 14th is 46.25 but my running avg column shows (table 2 below) 45.83

How can I get the running average to calculate the average for individual orders till that day instead of taking average of "average fees by day"? How do I get 46.25 in the running average for 14th instead of 45.83? Any help you can provide to fix the expression for Running average would be greatly appreciated.

In my actual report, the date range is flexible, so it is not MTD or fixed range and we can have any number of days (1 to 31) in the list.

Data:

Order Day

OrderNumMyTestFee
10950482045
11950289445
11950526445
13955654945
13955747145
14955675545
14955696745
14955744855


Report:

Order DayAvg FeeRunning Avg
1045.0045.00
1145.0045.00
1345.0045.00
1448.3345.83
Total46.25-


Thanks a lot in advance!

Archana.

2 Replies
Not applicable
Author

added a new expression 

= avg(aggr(avg(MyTestFee ),OrderDay)) 

CELAMBARASAN
Partner - Champion
Partner - Champion

Try with this expression

if(RowNo()=0,

RangeAvg(ABOVE(Avg(MyTestFee),0,Count(DISTINCT OrderDay))), RangeAvg(ABOVE(Avg(MyTestFee),0,RowNo())))

Hope it helps