Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
OJT
Contributor II
Contributor II

Combining two variables

Hi, 

 

I have used a Left join below to try and combine the spend ratings into categories. Fro example I have tried to combine the Total spend of spend rating 10 and 9 into category 5. But Category 5 still displays the separate spend ratings Total spend. 

clipboard_image_0.png

clipboard_image_2.png

How do I get Category 5 to be the sum of BOTH 10 and 9 spend ratings Total spend?

 

Regards, 

Oscar 

Labels (2)
1 Solution

Accepted Solutions
Kashyap_R
Partner - Specialist
Partner - Specialist

Try using this in the script editor

Load       Rating,
                 if(Match(Rating,'1','2'), 'C1',
                     if(Match(Rating,'3','4'),'C2',
                          if(Match(Rating,'5','6'),'C3',
                               if(Match(Rating,'7','8'),'C4',
                                    if(Match(Rating,'9','10'),'C5'))))) as RatingCategory
Resident Rating;

 

Hope it helps 

Thanks,

Thanks and Regards
Kashyap.R

View solution in original post

2 Replies
Kashyap_R
Partner - Specialist
Partner - Specialist

Try using this in the script editor

Load       Rating,
                 if(Match(Rating,'1','2'), 'C1',
                     if(Match(Rating,'3','4'),'C2',
                          if(Match(Rating,'5','6'),'C3',
                               if(Match(Rating,'7','8'),'C4',
                                    if(Match(Rating,'9','10'),'C5'))))) as RatingCategory
Resident Rating;

 

Hope it helps 

Thanks,

Thanks and Regards
Kashyap.R
OJT
Contributor II
Contributor II
Author

Perfect, exactly what I was trying!