Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
bhawna_agrawal
New Contributor II

How to compare string type variable values through if statement

Hi All,

Below is my current bar chart. I have a requirement that instead of 4 type of user types coming from database this chart have only 2 types of user type. From DB we will have 4 user type data but in chart it shows only 2 i,e, employee and contractor. If user type is either employee or intern then they both combine to employee and if usertpe is contractor or customer then they both combine and show as contractor. Below is the script i am using to load data and tied with if statement(currently commented) bit didn't worked.

userType chart.png

script.png

5 Replies
andrey_krylov
Valued Contributor

Re: How to compare string type variable values through if statement

If(Match(user_emp_type, 'Employee', 'Intern'), 'Employee', 'Contractor') as user

Partner
Partner

Re: How to compare string type variable values through if statement

Hi,

Apply what Andrey said above in script and then use that as dimension.

Should be good

Best,

Ali A

Partner
Partner

Re: How to compare string type variable values through if statement

Also,

Please stop making threads with the exact same question. I count 3 threads with the exact same question?

Best,

Ali A

bhawna_agrawal
New Contributor II

Re: How to compare string type variable values through if statement

Thanks for your response. Actually there was some issue due to which while submitting the post it was throwing some error but actually it was submitted at back end.

bhawna_agrawal
New Contributor II

Re: How to compare string type variable values through if statement

Thanks Andrey, solution provided by you worked perfectly.