Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
byrnel0586
Creator
Creator

Aggr expression using TOTAL

Hi all,

I am trying to create an expression as a calculated dimension within a pivot table. The table could have multiple PCPs listed but not selected and I'd like the expression to show an overall weighted avg value regardless of selection. I have tried using TOTAL and it works when a PCP is selected, but is aggregating all PCPs if multiple or none are selected.

=if(num(ReportDate) < '43312',
SUM(TOTAL(Aggr(
IF($(RoundedRate%)>=num#(PtileBeg) and $(RoundedRate%)<= num#(PtileEnd)
,
Star) * Only(RptCardWeight)
,
Star,_MeasureYearKey)))
/
SUM(TOTAL( RptCardWeight)),
round(SUM(TOTAL(Aggr(
IF($(RoundedRate%)>=num#(PtileBeg) and $(RoundedRate%)<= num#(PtileEnd)
,
Star) * Only(RptCardWeight)
,
Star,_MeasureYearKey)))
/
SUM(TOTAL(RptCardWeight)) ,0.1))

Any help is much appreciated.

Thank you.

3 Replies
vishsaggi
Champion III
Champion III

TOTAL Qualifier respects your dimension selections. So what are you trying to achieve. ?

byrnel0586
Creator
Creator
Author

I am wanting the calculation to show the overall score for each PCP regardless of selection. When I try that expression without the TOTAL it says error as a calculated dimension. It works as an expression in a straight table though.

vishsaggi
Champion III
Champion III

May be try like

Sum( TOTAL <PCPFieldname> .....)