Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
bellesol
Creator
Creator

Show total row when using Only function in set analysis

Hi,

How can I Display the total row when I use a non-aggregate function in  Set analysis?

the calculation is like this:

aggr(Only({$<Year={$(=max(Yea))}>}Name),ListOfOtherDimensions)

It works but I want to display the total row of the chart

 

Labels (3)
4 Replies
Vegar
MVP
MVP

How do you want to calculate the total row? It looks like you are listing names, how would the total of a set of names look like? Please explain. 

Kushal_Chawda

@bellesol  looks like your set analysis returns text value which means total can't be calculated.  You should have numeric values to get total. If you mean that you have numeric field with same expression then try below

sum(aggr(Only({$<Year={$(=max(Yea))}>}Name),ListOfOtherDimensions))

bellesol
Creator
Creator
Author

Hi,

sorry my bad, I didn't mention that the field NAME is actually a numerical field (I know I know... but that's the way it is - I didn't build this DB...:)) 

The table is a pivot table and I need to display this field without doing SUM aggr. (show it as is, as a dimension in the "measures area" ) 

when I use the calculation I wrote, the value is OK but the total row is getting the value "-", how can I sum up only the total row?

I hope I'm clear. 

 

Vegar
MVP
MVP

You can do a conditional expression using IF() and Dimensionality(), like this.

IF( Dimensionality() >0, YourRowExpression, YourTotalExpression)