Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
curt1094
Partner - Contributor II
Partner - Contributor II

Creating a nest if statement with set analysis

Hi,

I'm trying to create a nest if statement that allows me to search a field called [KPI.KPI] for a value of 16 then counts records for [ERRORS.BUSINESS_PROCESS] where [ERRORS.BUSINESS_PROCESS] not "LABOR" and the field [ERRORS.TOT_TRANS_AMT] is not 0 and not null. I was thinking it should be written like this, but I have had no luck. 

If( KPI.KPI = 16,

      If( [ERRORS.BUSINESS_PROCESS] -= {"LABOR"} and [ERRORS.TOT_TRANS_AMT] -= {"0", null},

      Count([ERRORS.BUSINESS_PROCESS] )

          )

    )

Any help would be greatly appreciated. Thank you in advance.

 

Labels (1)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

Try

Count({$<KPI.KPI = {16}, ERRORS.BUSINESS_PROCESS -= {"LABOR"},

ERRORS.TOT_TRANS_AMT={"*"}> * <ERRORS.TOT_TRANS_AMT={">0"}>} ERRORS.BUSINESS_PROCESS)

View solution in original post

2 Replies
BrunPierre
Partner - Master II
Partner - Master II

Try

Count({$<KPI.KPI = {16}, ERRORS.BUSINESS_PROCESS -= {"LABOR"},

ERRORS.TOT_TRANS_AMT={"*"}> * <ERRORS.TOT_TRANS_AMT={">0"}>} ERRORS.BUSINESS_PROCESS)

curt1094
Partner - Contributor II
Partner - Contributor II
Author

Thanks, this produced the result I was looking for.