Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
lincoln
Partner - Contributor II
Partner - Contributor II

How to get classes of this range

$0   $ 5,000
$5,001  $ 8,000
$8,001  $ 12,000
$12,001  $ 15,500
$15,500 $ Above
Labels (1)
  • SaaS

4 Replies
sidhiq91
Specialist II
Specialist II

Hello,

You can use the below expression in the script editor. Please let me know if that had helped.

Pick( Match(-1,Sales>=0 and Sales<=5000,
Sales>5000 and Sales<=8000,
Sales>8000 and Sales<=12000,
Sales>12000 and Sales<=15500,
Sales>15500),
'0-5000','5000-8000','8000-12000','12000-15500','Above') as Bucket

lincoln
Partner - Contributor II
Partner - Contributor II
Author

can you explain why -1?

MayilVahanan

HI

Try like below, dual function helps for sorting purposes

=if(Sales<=5000, Dual('below 5000', 1),
if(Sales<=8000, Dual('5001-8000',2),
If(Sales<=12000, Dual('8001-12000',3),
If(Sales<=15500, Dual('12001-15500',4), Dual('Above 15500', 5)))))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
sidhiq91
Specialist II
Specialist II

@lincoln  Please mark it as a solved, if it has resolved your issue. Thanks.