Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Grouping By Dollar Value

I am looking to organize my data by groups by revenue. The revenue is the only calculated field. The groups I am working with are as follows:

0-100

100-300

300-500

500+

Any idea as how to tackle this? I'm still very new to Qlik code and syntax.

Thanks

1 Solution

Accepted Solutions
sunny_talwar

Assuming Revenue by XYZ field, you can try this to create your buckets on the front end

Aggr(

If(Sum(Revenue) < 100, Dual('0-100', 1),

If(Sum(Revenue) < 300, Dual('100-300', 2),

If(Sum(Revenue) < 500, Dual('300-500', 3), Dual('500+', 4)))), XYZ)

Also, look here:

Buckets

View solution in original post

8 Replies
sunny_talwar

Grouping how? Revenue per Customer? Revenue per Year? or just individual rows of revenue?

sunny_talwar

Assuming Revenue by XYZ field, you can try this to create your buckets on the front end

Aggr(

If(Sum(Revenue) < 100, Dual('0-100', 1),

If(Sum(Revenue) < 300, Dual('100-300', 2),

If(Sum(Revenue) < 500, Dual('300-500', 3), Dual('500+', 4)))), XYZ)

Also, look here:

Buckets

Anonymous
Not applicable
Author

Thanks for the response. That worked perfectly. If I wanted to make these same categories on the back end to apply to multiple tables or sheets how would I go about that?

sunny_talwar

Again it would depend on which level are you wanting to do it at? Row Level? One dimension level? Multiple dimensions level?

Anonymous
Not applicable
Author

What do you mean by multiple dimensions level? Is that multiple categories?

sunny_talwar

Would you be able to share a sample with expected output?

Anonymous
Not applicable
Author

Something like this. Two tables:   

Rev Catpre policy changepost policy change
0-100order qtyorder qty
100-300order qtyorder qty
300-500order qtyorder qty
500+order qtyorder qty

Rev Cat

pre policy change

post policy change

0-100Total $ orders + FeesTotal $ orders + Fees
100-300Total $ orders + FeesTotal $ orders + Fees
300-500Total $ orders + FeesTotal $ orders + Fees
500+Total $ orders + FeesTotal $ orders
sunny_talwar

I was looking for a numerical data with specific output you look from that raw data