Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Aggr function is not working correctly

Dear QV experts,

As you can see in the pivot table below I have a problem with the aggr function. In the 7th row (Tot Geinv vermogen saldo) I would like to show the total across all Vestiging_Naam for each AsOfPeriod using the following expression:


=aggr(Sum({<Resultaatgroep1={[Geinv]},PeriodType={[Current]}>} BedragSaldi),AsOfPeriod)


However this expression is only shown correctly on the first line and is shown incorrectly (in fact not all) in the subsequent lines.

Do you have any thoughts what I am doing wrong.

Regards,

Rudi

QV Comm Question.png

1 Solution

Accepted Solutions
sunny_talwar

Can you try this:

Sum(TOTAL <AsOfPeriod> Aggr(Sum({<Resultaatgroep1={[Geinv]},PeriodType={[Current]}>}BedragSaldi),Vestiging_Naam,AsOfPeriod))

View solution in original post

6 Replies
Kushal_Chawda

try this

sum(aggr(Sum({<Resultaatgroep1={[Geinv]},PeriodType={[Current]}>} BedragSaldi),Vestiging_Naam,AsOfPeriod))

sunny_talwar

Like Kush pointed out, you need to add all your dimensions within the Aggr function. What all dimensions do you have?

Anonymous
Not applicable
Author

Kush, Sunny,

First of all thanks for your quick responses.

I have two dimensions: AsOfPeriod (the time dimension) and Vestiging_Naam (in English: the outlet). I need in each line the total of all outlets (Vestiging_Naam) per period (as reference number). The suggested expression of Kush is giving me - as you can see below - the total per outlet but not the total of all outlets.

QV Comm Question 2.png

Any thoughts here?

Many thx,

Rudi

sunny_talwar

Can you try this:

Sum(TOTAL <AsOfPeriod> Aggr(Sum({<Resultaatgroep1={[Geinv]},PeriodType={[Current]}>}BedragSaldi),Vestiging_Naam,AsOfPeriod))

Anonymous
Not applicable
Author

Sunny,

This works!!!!

I now see what I've done wrong!

Many thx for your help!

Regards,

Rudi

sunny_talwar

Not a problem. I am glad me and Kush were able to help you out