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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

grouping values

Hi I got a field (A) with values going from 1 to 9 (maybe with new data will go over 10) and i need to group them into 3 categories of a new field (B):

If A=1 then B='1'

If A=2 then B='2'

If A>=3 then B='3+'

could you help me in writing the right script to build up the new field?

Thanks in advance

Labels (1)
2 Replies
SunilChauhan
Champion II
Champion II

use below code

If (A=1, B='1',

If (A=2 , B='2',

If (A>=3 , B='3+')))

hope this helps

Sunil Chauhan
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Load

               A,

               If(A=1,'1',If(A=2,'2',if(A>=3,'3+'))) AS B

     From

               Table;

May be your need is this..

Celambarasan