Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
akuttler
Creator
Creator

IF statement as Custom dimension

Hi,

I have a group of store locations.. I need to identify as either "Joint Venture" or "Enterprise" in my charts.

I have a custom dimension with the following expression:

=IF(StoreName = 'Derm 1' or

'Derm 3' or 'Derm 4', 'Enterprise', 'Joint Venture')


But it only picks up 'Derm 1' as  Enterprise and not the other two. What am I missing?


Thanks in advance.

1 Solution

Accepted Solutions
sunny_talwar

Try this

=If(Match(StoreName, 'Derm 1', 'Derm 3', 'Derm 4'), 'Enterprise', 'Joint Venture')

View solution in original post

11 Replies
sunny_talwar

Try this

=If(Match(StoreName, 'Derm 1', 'Derm 3', 'Derm 4'), 'Enterprise', 'Joint Venture')

pamaxeed
Partner - Creator III
Partner - Creator III

Try this:

if(match(StoreName, 'Dem 1','Dem 3','Dem 4') > 0, 'Enterprise', 'Joint Venture') as Dim1


Regards,

Patric

akuttler
Creator
Creator
Author

Thanks, works great.

devarasu07
Master II
Master II

Hi,

you have missed to call that field name for multiple times like below

basic if condition :

=IF(StoreName = 'Derm 1' or StoreName = 'Derm 3' or StoreName = 'Derm 2' ,'Enterprise', 'Joint Venture')


simplified if condition

if(match( StoreName , 'Derm 1' ,'Derm 3','Derm 2') ,'Enterprise', 'Joint Venture')

and if you wish to apply wildcard then try to use like below

example, if u like to search all StoreName starting with Derm* then u can define like below,

If(WildMatch(StoreName , 'Derm*'),'Enterprise', 'Joint Venture')


Thanks,Deva

sunny_talwar

devarasu07‌ you have been all about options recently. I like it ... Always good to have multiple ways to do the same thing. Thanks for your contribution

akuttler
Creator
Creator
Author

Thanks, the wildcard will work even better.

devarasu07
Master II
Master II

Hi stalwar1

Thank you! , You're the most Inspiration for all the Qlik newbie and thanks you too for the valuable contribution.

Regards,

Deva

pablolabbe
Luminary Alumni
Luminary Alumni

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

pradosh_thakur
Master II
Master II

try this as well with wild card

pick(WildMatch(StoreName , 'Derm*')+1,'Joint Venture','Enterprise')

Learning never stops.