Discussion board where members can learn more about Qlik Sense App Development and Usage.
I am attempting to work out a rolling average based on the last 4 visits a car had calculated by a visit time. Data as shown below:
I would want an extra column on the table with an average like the below:
I am attempting to use something like:=avg(aggr(FirstsortedValue(DurationMins,VisitDate),CarName))
But I cannot get it to fit my requirement of last 4 visits.
Any help would be great!
I do not understand the final measure that you need and why you use FirstSortedValue(), so I cannot provide a working expression. However, if you would like to calculate an average over the last four rows the function Below() will do the job.
Hope it helps!
I was just attempting to get something to work...
Thanks to your pointer I then have gone for:
=Aggr(RangeAvg(Below(([DurationMins]),0,4)), 0, [CarName], VisitDate)
This gives me no results 😣