Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
mikegauntlett
Contributor III
Contributor III

Sum(if(

Hi Guys,

I have

SUM(IF((IF(IsNull(AARO_Booking_Period) and IsNull(Status),'R0',If (IsNull(Status),'R1',Status)))='R0',1,0))

which sums the total for a set tollgate in this case R0 as underlined.

the R tollgate will either come from the IF statement:

IF(IsNull(AARO_Booking_Period) and IsNull(Status),'R0',If (IsNull(Status),'R1',Status))

or from the Status field itself.

This works for R0 and R1 when I change the underlined but not for any other.

I have tried sum(IF(Status='R2' etc. but this also does not work any Ideas?

As always greatly appreciated.

4 Replies
sunny_talwar

You want to count when Status is R2? May be this

Count({<Status = {'R2'}>}Status)

mikegauntlett
Contributor III
Contributor III
Author

Hi Sunny,

Afraid Not,

so for the 4 possible outcomes R0, R1, R2, R3.

The R0 & R1 will solely come from the IF statement:IF(IsNull(AARO_Booking_Period) and IsNull(Status),'R0',If (IsNull(Status),'R1',Status))


whereas the R2 & R3 will come from the status field which comes from an attached file.


I use the above IF as a master measure 'Master status'

vkish16161
Creator III
Creator III

You can probably look at using the Aggr function

Sum(Aggr(if(condition_true,1,0) , Dimension))

mikegauntlett
Contributor III
Contributor III
Author

Afraid not @Vishnu_Chakravaram