Select to view content in your preferred language

How can I sort a category in a dashboard by a custom order?

6650
13
07-11-2018 02:02 PM
CelesteIllian
New Contributor II

How can you customize sort order in a category selector? For example, I want to sort a category field with categories: "yes", "no", and "unknown", but I don't want them in alphabetical order (ascending or descending).  What do I do?

13 Replies
MJBiazar
Esri Contributor

What you see in the drop-down for "day_num" field are actually domain labels. So as long as you have numbers as codes and days of the week as labels, you should be able to sort your serial chart in your dashboard. 

Can you share your feature layer or the FGDB that contains your data so I can have a better understanding of your data and run more test?

Thanks,

MJ

0 Kudos
SamirFarhat
New Contributor II

The expression you sent would not work for me. Ended up using this:

When(
$feature["day_of_week"] == 'Monday', '1',
$feature["day_of_week"] == 'Tuesday', '2',
$feature["day_of_week"] == 'Wednesday', '3',
$feature["day_of_week"] == 'Thursday', '4',
$feature["day_of_week"] == 'Friday', '5',
$feature["day_of_week"] == 'Saturday', '6',
$feature["day_of_week"] == 'Sunday', '7',
'0')

All good now! Thank you.

BrynMorris-hale
New Contributor II

Hi there,

I have a similar issue. I'm trying to sort a serial chart in a dashboard by 5 year age bands.

The age bands aren't sorting properly as they go beyond 100. I've created a new numeric field in my feature class, to be used for sorting. However once the layers is uploaded to AGOL, it wont let me select it as a sort field when I'm setting up my serial chart. My only option is to select my age band field.

I also tried creating domains in my FGBD for the age bands so they are recorded as codes. But this hasn't worked either.

Any suggestions would be greatly appreciated.

Thanks

0 Kudos
MJBiazar
Esri Contributor

Bryn Morris-hale

Hi,

In this workaround, you are basically using your category field to sort by using domains. You can not use a field as category field and use a different field to sort categories on the chart.

You need to create domains for the "AgeBand" field and make sure that numeric values are assigned as codes (not labels).

All the best,

MJ

0 Kudos