Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
luohda
Contributor III
Contributor III

rolling 12 months sum with calculation seperatetly

I have searched quite a lot, have seen https://community.qlik.com/t5/QlikView-Documents/Calculating-rolling-n-period-totals-averages-or-oth... , but it doesn't work for me, cause the sum object is not as simple as each month corresponding to 1 summing object.

my per month value is:

sum({<Parameter={'L6027'}>}[T_RESULTATE.MITTELWERT])/Count(distinct aggr(Tournummer, MesspunktProbe))

each orange object and each green object have 1 commen ID to link them together, and there is 1 ID per month, these two are in 2 different tables, but linked together through this commen ID. For each commen ID the Date are the same for both.

the 12 month rolling is:

sum(aggr(
rangesum(
above(total
sum({<Parameter={'L6027'}>*<
[T_AUFTRAEGE.DAT_PROBENAHME.DATUM]=,[T_AUFTRAEGE.DAT_PROBENAHME.MONTH]=,[T_AUFTRAEGE.DAT_PROBENAHME.YEAR]=,[T_AUFTRAEGE.DAT_PROBENAHME.MONTHYEAR]=
>}[T_RESULTATE.MITTELWERT])/Count(distinct aggr(Tournummer, MesspunktProbe))
,0,12))
,([T_AUFTRAEGE.DAT_PROBENAHME.MONTHYEAR],(numeric, ascending))))

the time fields are in the 1st table, but they are the same per common ID

data model:

Annotation 2020-02-18 142842.png

result looks like this:

Annotation 2020-02-18 151248.png

it only does a normal accumulative sum, but not rolling sum for each month for the months that I selected.

Labels (2)
0 Replies