Age Range in ascending order instead of alphanumeric

Hi community,
I am using a calculated field as filter. This field contains age range (0-10, 11-20 and so on) but in filter it is sorted alphanumerically. I want it in continuation. Is there a possible way to get it done.

image

Thanks in advance.

Regards,
Raghu Pratap Singh

Hi @Raghu,

There is a solution for this issue, but it might not be the best solution for your scenario but you can give it a try.

ifelse(Quantity=1," 0-10",Quantity=2," 11-20",Quantity=3," 21-30",Quantity=4," 0-",Quantity=5,β€œ100-110”,β€œ200-210”)

Above mentioned is a sample formula,
where I have left one string space after every condition (" 0-10") for the one and two digit ranges but for the three digit range I haven’t left any string space (β€œ100-110”).

Let me know if you need further assistance on this issue.

Thanks

1 Like

Hi @Yamini_Baskar_24
Thanks for your time. I tried this solution but results were same in dropdown filter.

Hi @Raghu

Not sure if we can achieve exactly how you expect in the filter control. But you can do a bit of work around in your calculation to have the age range in order in your filter control. Instead of 0 - 10, 11-20, 21-30, 31-40, 41-50, 51-60, 61-70, 71-80, 81-90, 91-100 try this numeric format 000 - 010, 011 - 020, 021 - 030, 031 - 040, 041 - 050, 051 - 060, 061 - 070, 071 - 080, 081 - 090, 091 - 100 in your ifelse condition

Hi @Raghu
Just give some space e.g quantity _ 1, β€œ0-10” it will work for you!

ifelse(Quantity=1, " 0-10",Quantity=2, " 11-20",Quantity=3, " 21-30 β€œ,Quantity=4 ,” 0-",Quantity=5, β€œ100-110”, β€œ200-210”)