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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is it possible to group ordervalues in an expression in a listbox

Hello,

I have created an expression in a listbox that says:

=Aggr(Sum(Web_OrderValue), Web_CustomerId)

This is working and the result I get in my listbox is all DISTINCT OrderValues.

However the end user of my application want's to be able to use intervals instead in the listbox:

e.g.

0 - 99:-

100-299:-

300- 499:-

aso

Is there anyone that knows of a way to pull this off?

I thought of using LOAD INLINE mapping

1, ''0-99'

2, '0-99'

But there has to be a better way.

br

Martin

4 Replies
johnw
Champion III
Champion III

Perhaps this?

aggr(class(sum(Web_OrderValue),100),Web_CustomerId)

Not applicable
Author

Hello,

Thank you for your reply.

It worked very well.

But if it is possible I would like to use these intervalls:

1-99
100-299
300-499
500-699
700-899
900-1099
1100-1999
2000-2999
3000-3999
4000-4999
5000-

The problem with your solution is that it requires that the intervalls are always of the same size and this is not the case for me.

Do you have any idea how to pull this off?

br
Martin

johnw
Champion III
Champion III

Brute force, I suppose.

aggr(if(sum(Web_OrderValue)<100,'1-99'
,if(sum(Web_OrderValue)<300,'100-299'
,if(sum(Web_OrderValue)<500,'300-499'
...
,if(sum(Web_OrderValue)<5000,'4000-4999'
,'5000+')))))))))),Web_CustomerId)

Not applicable
Author

Hello again,

Thank you, it worked perfectly.

br
Martin