Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Roberto03
Contributor II
Contributor II

RangeSum in Pivot Table

Hi all,

I have created a pivot table with 2 dimensions 'Denominazione' and 'Month(Data_Calendario)' 

The measure  (GG_ Franchigia_KPI_A) is calulated as follow: 

SOGLIA_TEMP_KPI_A - SUM(CABINA_INATTIVA)*PERC_A) - rangesum(above(total sum(ANOMALIE_KPI_A_SNAM), 0, rowNo()))

where the value "SOGLIA_TEMP_KPI_A - SUM(CABINA_INATTIVA)*PERC_A) "

is progressively reduced on the basis of "rangesum(above(total sum(KPI_A_SNAM) ANOMALIES), 0, rowNo()) " values.

Roberto03_1-1673433515380.png

however I can't get the maximum value (-26.25) to appear in the pivot totals row at the top

Roberto03_2-1673433813244.png

 

I have used 

Max(TOTAL Aggr(

(SOGLIA_TEMP_KPI_A - SUM(CABINA_INATTIVA)*PERC_A) - rangesum(above(total sum(ANOMALIE_KPI_A_SNAM), 0, rowNo()))

, Denominazione))

or 

min( total <Denominazione,DATA_CALENDARIO> Aggr(

(SOGLIA_TEMP_KPI_A - SUM(CABINA_INATTIVA)*PERC_A) - rangesum(above(total sum(ANOMALIE_KPI_A_SNAM), 0, rowNo()))

, Denominazione, (DATA_CALENDARIO, (Ascending))))

but i only have the max value in all cells

Roberto03_3-1673434006497.png

 

Thx in advance

Labels (1)
1 Solution

Accepted Solutions
E_Røse
Creator II
Creator II

@Roberto03 

Can use the dimensionality() function, to choose from two different expressions?

ElinR_0-1673446073640.png

 

View solution in original post

3 Replies
E_Røse
Creator II
Creator II

@Roberto03 

Can use the dimensionality() function, to choose from two different expressions?

ElinR_0-1673446073640.png

 

Roberto03
Contributor II
Contributor II
Author

THANKS @E_Røse 

how it work, from the pics I can not see the formula.

thanks

 

Roberto03
Contributor II
Contributor II
Author

ok I have found

if(dimensionality() = 1,
min( total <Denominazione,DATA_CALENDARIO> Aggr(
(SOGLIA_TEMP_KPI_A - SUM(CABINA_INATTIVA)*PERC_A) - rangesum(above(total sum(ANOMALIE_KPI_A_SNAM), 0, rowNo()))
, Denominazione, (DATA_CALENDARIO, (Ascending))))
,if( dimensionality()= 2,
(SOGLIA_TEMP_KPI_A - SUM(CABINA_INATTIVA)*PERC_A) - rangesum(above(total sum(ANOMALIE_KPI_A_SNAM), 0, rowNo())))
)

thanks