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: 
Not applicable

Sum Nested If state in expression

Currently I have a sum working correctly if one of the two values is selected.  If I select A, i get the sum of the associated column, if I select B, I get the sum of the associated column and if I chose both from the filter box, I get the total summed of the two selection correctly.  The issue I am having is that if nothing is selected in the filter box, I also want to show the total summed since nothing is selected, but current I get a larger number in the KPI box than is possible, so something is double counting

WARR_CAT is a filter box

Sum(if( WARR_CAT = 'WARR',WARR_TOTAL_COST_USD, if( WARR_CAT = 'MA',MA_TOTAL_COST_USD, MA_WARR_TOTAL_COST_USD)))

If both are selected and if neither is select I want the sum of MA_WARR_TOTAL_COST_USD

Any ideas?

thanks,

Michael

1 Reply
sunny_talwar

May be try this:

If(Concat(WARR_CAT) = 'WARR', Sum(WARR_TOTAL_COST_USD),

If(Concat(WARR_CAT) = 'MA', Sum(MA_TOTAL_COST_USD), Sum(MA_WARR_TOTAL_COST_USD)))