Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Proper format for 'or' expression statement

I'd like to count records when defect starts with 'F' or ChargeDept starts with 'P'.  I've tried the following and a few variations with no success.

= Count({<T_Defect = {'F*'}>} or {<T_ChargeDept = {'P*'}>} T_TrackingID)

Also, what would be the format if I wanted to list some ChargeDepts instead of using the like statement.  Is there somewhere good to go for reference on how to set up these statements - I seem to be getting tripped up a lot on this formatting - not like anything I've done before.

1 Solution

Accepted Solutions
Jason_Michaelides
Luminary Alumni
Luminary Alumni

No, I don't think it will double-count.

Sorry - you shouldn't close the {} before the +:

Count({<T_Defect = {'F*'}>+<T_ChargeDept = {'P*'}>} T_TrackingID)

View solution in original post

6 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Try:

Count({<T_Defect = {'F*'}>} + {<T_ChargeDept = {'P*'}>} T_TrackingID)

MayilVahanan

Hi


Try like this

Count({<T_Defect = {'F*'}>} + {<T_ChargeDept = {'P*'}>} T_TrackingID)


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

I'm getting an error in expression message starting with the second {.  Hopefully image comes though.  Also would this expression double-count if a record meets both criteria - the intention would be to count only once.  Thanks for the help.error.JPG

Jason_Michaelides
Luminary Alumni
Luminary Alumni

No, I don't think it will double-count.

Sorry - you shouldn't close the {} before the +:

Count({<T_Defect = {'F*'}>+<T_ChargeDept = {'P*'}>} T_TrackingID)

Not applicable
Author

You were right - it did not double count.  Can you give me the format if I wanted to list several ChargeDept instead of using the like statement?

Also, is there a good place to go look at some examples for these type things.  I looked through the reference manual pretty quickly but did not see anything.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Count({<T_Defect = {'F*'}>+<T_ChargeDept = {'P','OtherDept1','OtherDept2','etc'}>} T_TrackingID)

I think the F1 help is pretty good for Set Analysis, otherwise there's loads of stuff in here. There's even a Set Analysis Expression Builder app somewhere...