Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
samvile18
Contributor II

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
MVP & Luminary
MVP & Luminary

Re: How do I group my data?

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
nicklisterman
Contributor II

Re: How do I group my data?

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

MVP & Luminary
MVP & Luminary

Re: How do I group my data?

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

calvindk
Contributor III

Re: How do I group my data?

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
Contributor II

Re: How do I group my data?

This is brilliant, thanks for all of the help.