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 numeric values

Hi,

I have a field on a table which takes numeric values which can range from 1 through to , lets say, 97 although the upper value can be any number

I want to be able to write, ? a mapping, ? which will group these numbers as

Number Group

1 1

2 2

3 3

4 4+

5 4+

etc

but it must be able to capture all possible number from 4 up to the highest number into the 4+ group.

Any ideas?

Thanks

Labels (1)
1 Solution

Accepted Solutions
vgutkovsky
Master II
Master II

I would recommend using a simple IF statement since your group# = your number. It would look like this:

if(number<4,number,'4+') as Group;


Regards,

View solution in original post

2 Replies
vgutkovsky
Master II
Master II

I would recommend using a simple IF statement since your group# = your number. It would look like this:

if(number<4,number,'4+') as Group;


Regards,

Not applicable
Author

Hi,

eg use this as expression:

if(ProductCode<4, ProductCode,'4+')

Greetings,

Piet