Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I need to create a set Analysis to have the total of the 11 prior months of the current selection.
Here is my code:
sum({$<Reference_Value_Mois= {$(>=Max(Reference_Value_Mois)-11)}>}
sum(aggr($(vRevisedCabNP_Devise),DLP_NOM,Reference_Value_REG_NOM,Reference_Value_Annee,Reference_Value_Mois))
)
There is two points...
First my main expression is:
sum(aggr($(vRevisedCabNP_Devise),DLP_NOM,Reference_Value_REG_NOM,Reference_Value_Annee,Reference_Value_Mois))
1. Qlik does not alow nested aggregation!
2. What I want to achieve is having on the same line the value for the selected month and next to it the value for the total of the 11 previous months regarding the above expression.
Thank you for your help or advices.
Regards,
Alexandre
Calculating rolling n-period totals, averages or other aggregations
Qlik allows nested aggregation.
$-sign expansion and set analysis is calculated once for the whole chart. So you can't use it to create rolling calculations.
Hello,
Thank you for the link.
But I need to calculate the value not in a table, but in a field (text object) for further calculations.
When I use the following expression I do recieve the message:
''Nested aggregation not allowed''
=sum({<Reference_Value_Mois={'>=$(=only(Reference_Value_Mois)-11)<=$(=only(Reference_Value_Mois))'}>}
sum(aggr($(vRevisedCabNP_Devise),DLP_NOM,Reference_Value_REG_NOM,Reference_Value_Annee,Reference_Value_Mois)
)
)
Alexandre
It's because you use two nested Sum() functions.