9 Replies Latest reply: Jun 28, 2018 8:40 AM by Jurien Groot

# Aggr in calculated dimension

I have an aggr dimension that works:

aggr(if(rank(\$(vKPI_Global_Score_YTD))=2,[Customer]),[Customer])

It returns the Customer who has the 2nd highest score for the variable.

Now I want a calculated dimension that should work something like:

IF([Customer] = aggr(if(rank(\$(vKPI_Global_Score_YTD))=2,[Customer]),[Customer]) AND Zone = 'ABC', [Customer Zone])

I also tried something like:

aggr(if(Customer=aggr(if(rank(\$(vKPI_Global_Score_YTD))=2,[Customer]),[Customer]) and Zone ='ABC', [Customer Zone], [Customer Zone])

This however isn't working for both.

Any Idea?

• ###### Re: Aggr in calculated dimension

maybe this:

=Only( {< Customer = {"\$(=rank(\$(vKPI_Global_Score_YTD)))=2"} >} [Customer Zone] )

• ###### Re: Aggr in calculated dimension

his second condition is missing:

=Only( {< Customer = {"\$(=rank(\$(vKPI_Global_Score_YTD)))=2"},Zone={'ABC'}>} [Customer Zone] )

• ###### Re: Aggr in calculated dimension

Hi

may be this

=Only( {< Customer = {"\$(=rank(\$(vKPI_Global_Score_YTD)))=2"},Zone ={'ABC'} >} [Customer Zone] )

or this

aggr(

if(

rank(\$(vKPI_Global_Score_YTD))=2 AND Zone ='ABC' ,[Customer]),[Customer])

• ###### Re: Aggr in calculated dimension

May I know what is the expression stored in "vKPI_Global_Score_YTD".

• ###### Re: Aggr in calculated dimension

It is a very complicated total score within +10 other variable calculations into it. The problem is that we need the score for just two dimensions without filtering. There is also no set analysis extra possible within the total score, so we are looking for a workaround.

• ###### Re: Aggr in calculated dimension

aggr(if(rank(\$(vKPI_Global_Score_YTD))=2,[Customer]),[Customer])

• ###### Re: Aggr in calculated dimension

Only results in a measure, I need it to result in a dimension.

• ###### Re: Aggr in calculated dimension

what's the chart object are you using to display the "Customer Zone" calculated dimension ?

• ###### Re: Aggr in calculated dimension

So I have \$(vKPI_Global_YTD) as a measure to be display in Simple KPI extension. The idea is to limit the score by only a combination of two dimension values Customer and Zone, therefor I concatenate it, because you can only have one dimension in Simple KPI.

aggr(if(rank(\$(vKPI_Global_Score_YTD))=2,[Customer]),[Customer]) as a dimension, gives me the required result, but it also needs to be limited by zone='EUR'...

If I make a regular table with:

Kolom 1

aggr(if(rank(\$(vKPI_Global_Score_YTD))=2,[Customer]),[Customer])

Kolom 2

aggr(if(Zone='EUR',[Zone]),[Zone])

Kolom 3

\$(vKPI_Global_YTD)

I do get the required value in Kolom 3...