10 Replies Latest reply: May 25, 2016 8:24 AM by Brijesh Fofadiya

# Sorting

these are the values

<100k

100k-250k

250k-1M

1M-3M

3M+

ENN

NHH

and I want them to appear in the same manner in the people chart

but the sorting isn't working.

I tried adding 1,2,3 numbers before these and sort them numerically but it is still not working

any way I can get this done?

• ###### Re: Sorting

Where are you using this? You can use Dual function to assign these numerical values if you want

• ###### Re: Sorting

People chart

How to use Dual Function?

These are the values that are there in excel data sheet but they appear in random order.

I want them to be in this order strictly

• ###### Re: Sorting

What is a people chart? I have never seen it before?

• ###### Re: Sorting

Something like this:

Dual(FieldName, Match(FieldName, '<100k', '100k-250k', '250k-1M', '1M-3M', '3M+', 'ENN', 'NHH'))

• ###### Re: Sorting

Hi Sagarika,

If you have numbers for each of the values in your data model, you can use that filed in the "sort by expression" property in the properties panel.

• ###### Re: Sorting

yes I have numbers. for ex: <100k I have some 40K people again for 100k-250k I have 50k people and so on.

I have tried using sort by expression

what code shall I use in the expression exactly?

I have tried everything

if, match, dual etc

• ###### Re: Sorting

HI Sagarika,

Is it possible to share your qvf?

• ###### Re: Sorting

may be try like this

filedname,s_no

<100k,1

100k-250k,2

250k-1M,3

1M-3M,4

3M+,5

ENN,6

NHH,7

];

in sort by expression give  s_no

• ###### Re: Sorting

HI Sagarika,

I also faced same issue before some days. First of all create one another dummy field of age in back-end for sorting purpose.

E.g :

if(Time(Time)<'9:00:00 AM','Before 9:00',

if(time(Time)>='9:00:00 AM' and Time(Time)<'10:00:00 AM','9:00 - 10:00',

if(time(Time)>='10:00:00 AM' and time(Time)<'11:00:00 AM','10:00 - 11:00',

if(time(Time)>='11:00:00 AM' and time(Time)<'12:00:00 PM','11:00 - 12:00',

if(time(Time)>'12:00:00 PM','After 12:00 '))))) as Time,

if(Time(Time)<'9:00:00 AM',1,

if(time(Time)>='9:00:00 AM' and Time(Time)<'10:00:00 AM',2,

if(time(Time)>='10:00:00 AM' and time(Time)<'11:00:00 AM',3,

if(time(Time)>='11:00:00 AM' and time(Time)<'12:00:00 PM',4,

if(time(Time)>'12:00:00 PM',5))))) as Time_Order,

and after creating dummy filed in expression use it in Sorting tab of a chart.

Do sort by Expression. Ascending and Write in expression :

= Time_Order

Take Your original field e.g Time as a dimension.

Regards,

Brijesh.