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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
samvile18
Creator III
Creator III

How do I group my data?

Hi all,

Quick question...how do I go about grouping some of my underlying data??

This is what I currently have:

A field named PRTY with data like this 100, 101, 102, 200, 201, 203, 300, 308, 309, 400 etc

How do I get that field to map to a high level group, so instead of showing the above it groups into fields like:

000+

100+

200+

300+

400+

So the 100's would go into 100+, the 200's would go into 200+ and so on...

Any help is greatly appreciated

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can use the floor function: floor(PRTY,100) as PRTY_Group. If you want the + added so you get 100+ I'd use this: dual(floor(PRTY,100)&'+',floor(PRTY,100))  as PRTY_Group. That way it will display as 100+ etc, but can still be sorted numerically.


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Anonymous
Not applicable

It's ugly but in a dimension you could do =Round(if(PRTY=0,PRTY,PRTY-50),100)

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can use the floor function: floor(PRTY,100) as PRTY_Group. If you want the + added so you get 100+ I'd use this: dual(floor(PRTY,100)&'+',floor(PRTY,100))  as PRTY_Group. That way it will display as 100+ etc, but can still be sorted numerically.


talk is cheap, supply exceeds demand
calvindk
Creator III
Creator III

In script:

repeat('0', (3 - len(Floor(PRTY/100)))) & Floor(PRTY/100)  & '+' as GroupName

or in expression:

repeat('0', (3 - len(Floor(PRTY/100)))) & Floor(PRTY/100)  & '+'

samvile18
Creator III
Creator III
Author

This is brilliant, thanks for all of the help.