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

Two Condition in Text Object Expression

Dear all,

I have the following code in the expression..

= SUM({$<b_UserDeptSection={'MACHINE LINE'}>} b_IndirectHours)

What is the best method to select the userdeptsection = 'NON MACHINE LINE' as well? My current solution as below

SUM({$<b_UserDeptSection={'MACHINE LINE'}>} b_IndirectHours) + SUM({$<b_UserDeptSection={'NON MACHINE LINE'}>} b_IndirectHours)

May i know is the SUM function will take in 2 condition for example (b_UserDeptSection= {'MACHINE LINE'} or b_UserDeptSection= {'NON MACHINE LINE'})??

Thank you

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this

= SUM({$<b_UserDeptSection={'MACHINE LINE', 'NON MACHINE LINE' }>} b_IndirectHours)

Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
MayilVahanan

Hi

Try like this

= SUM({$<b_UserDeptSection={'MACHINE LINE', 'NON MACHINE LINE' }>} b_IndirectHours)

Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks Mayil.


What about the 2 condition referring to different field?

one is b_UserDeptSection='MACHINE LINE'

and

b_UserAge>18

how do we put in a single SUM statement?

Not applicable
Author

Hi,

= SUM({$<b_UserDeptSection={'MACHINE LINE'}, b_UserAge ={'>18'}>} b_IndirectHours)

MayilVahanan

Hi

Try like this

=SUM({$<b_UserDeptSection={'MACHINE LINE'} , b_UserAge ={">18"} >} b_IndirectHours)

Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.