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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
NickHoff
Specialist
Specialist

if x = y converted to set analysis

Currently I have the expression IF(SUM(ALOS=ICUALOS, SUM({$<ExpiredIND = {'0'}>}Cases)).  I know there is a way to put the IF into the set.  How would I go about it? 

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I believe

SUM({$<ExpiredIND = {'0'},[Total ALOS]={"=[ICU ALOS]"}>}Cases))


-Rob

http://masterssummit.com

http://robwunderlich.com

View solution in original post

6 Replies
Clever_Anjos
Employee
Employee

Is this expression running?

It seems to be invalid to me

NickHoff
Specialist
Specialist
Author

Sorry, I typed that incorrectly.  The expression runs and is written as:

IF([Total ALOS]=[ICU ALOS], SUM({$<ExpiredIND = {'0'}>}Cases))

I'm looking to get rid of the IF statement and put [Total ALOS] = [ICU ALOS] in the set

Clever_Anjos
Employee
Employee

It´s hard without knowing your data, but

SUM({$<ExpiredIND = {'0'},Total ALOS]=P([ICU ALOS])>}Cases)) should work

NickHoff
Specialist
Specialist
Author

The data shouldn't matter.  I'm just trying to SUM a field we can call A when only ExpressionX = Expression Y.

Simliar to:

IF ExpressionX = ExpressionY, SUM(A).

Adding the P to the SET doesn't work, because it includes everything possible, not just WHERE X = Y.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I believe

SUM({$<ExpiredIND = {'0'},[Total ALOS]={"=[ICU ALOS]"}>}Cases))


-Rob

http://masterssummit.com

http://robwunderlich.com

NickHoff
Specialist
Specialist
Author

Rob,

It worked great, thank you.  It was nice meeting you at the conference, hopefully i'll see you in April at Qlik Masters.