Qlik Community

Ask a Question

New to Qlik Sense

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

Qlik Insider - Maximize your investment, Join this webinar, May 26th. Register Today
Showing results for 
Search instead for 
Did you mean: 
Contributor II
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


1 Reply

Try this:

IF(MATCH(usr_emp_type, 'Employee', 'Intern'), 'Employee', IF(MATCH(usr_emp_type, 'Contractor', 'Customer'), 'Contractor')) AS usr_emp_type