
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorting Straight Table column
Hi guys, I am trying to sort a column based on an expression I made for the dimension.
For ex:
=if([Num] < 500, '<500',
if([Num] >= 500 and [Num] < 1000, '500-1000',
if([Num] >= 1000 , '>=1000')))
How would I specify the sort order in the Sorting tab for this? I can't seem to get it. Thank you.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
not sure for not tested but try this
Sort by expression
=if([Num] < 500,1,
if([Num] >= 500 and [Num] < 1000, 2,
if([Num] >= 1000 , 3)))
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply but this does not work.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
what about this :
=if([Num] < 500, '<500',
if([Num] >= 500 and [Num] < 1000, '500-1000',
if([Num] >= 1000 , '>=1000',class([Num],500))))
or this :
=if([Num] < 500, dual('<500',1),
if([Num] >= 500 and [Num] < 1000, dual('500-1000',2),
if([Num] >= 1000 , dual('>=1000',3))))
and order by number ascending

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey, thank you again for your response. I tried both of these and still it's not working.
.png)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI Gary,
Option1:
"Sort alphabetically" option would work in the case of calculated dims,
Option2:
use below expression in "Sort by expression"
=Match( (if([Num] < 500, '<500',
if([Num] >= 500 and [Num] < 1000, '500-1000',
if([Num] >= 1000 , '>=1000'))) ),' <500','500-1000','>=1000')
OR calculate Dim at script level and use below expression
=Match( Num_script_cal , ' <500', '500-1000', '>=1000')
Thanks,
sasi
