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: 
satishkurra
Specialist II
Specialist II

CASE STATEMENT IN QLIKVIEW

Hi

I'm trying to convert the below case statement into QlikView.

Can someone help me on the same?

case

when "ProductID1" in ('1','2','3','4')

or  "ProductID2" in

     ('6','7','8','9')

then 'ProductGroup1'

else 'ProductGroup2'

end

Thanks

Satish

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

If(Match(ProductID1, 1, 2, 3, 4) or Match(ProductID2, 6, 7, 8, 9), 'ProductGroup1', 'ProductGroup2') as ProductGroup

View solution in original post

4 Replies
sunny_talwar

May be like this:

If(Match(ProductID1, 1, 2, 3, 4) or Match(ProductID2, 6, 7, 8, 9), 'ProductGroup1', 'ProductGroup2') as ProductGroup

satishkurra
Specialist II
Specialist II
Author

Sunny

Just a question out of curiosity, can't we use Pick in place of If?

satishkurra
Specialist II
Specialist II
Author

Sunny

Just a question out of curiosity, can't we use Pick in place of If?

sunny_talwar

I don't think Pick will be easy, but here is another option

If(WildMatch(ProductID1&'|'&ProductID2, '1|*', '2|*', '3|*', '4|*', '*|6', '*|7', '*|8', '*|9'), 'ProductGroup1', 'ProductGroup2') as ProductGroup