Select to view content in your preferred language

For best Dashboard charts, plan ahead in Survey123

432
0
04-26-2023 05:18 PM
Labels (1)
Kylie
by Esri Regular Contributor
Esri Regular Contributor
3 0 432

A fairly common scenario: A classroom collects data with Survey123 and wants to display the collected data in a dashboard. But on configuring the dashboard, the charts sort the choices alphabetically, which is not always the most logical order. This can be prevented by planning ahead: you can get the displays you want in the dashboard by naming your values with care as you author your survey.

Problematic data

First let's see where this problem might be seen. Here are some examples of data where alphabetical sorts are not desired:

  1. The month in which something happened. You expect to see the chart values going from January to December. But your dashboard will present them "April, August, December, February, etc."
  2. The time of day - morning, afternoon, evening, night. The dashboard charts show "afternoon, evening, morning, night."
  3. The class someone belongs to in high school - Freshman, Sophomore, Junior, Senior. The dashboard charts order these "Freshman, Junior, Senior, Sophomore."

I'm sure you can think of others: times where the words used have an expected order, and it's not alphabetical.

Default sort in a dashboard

Let's look at an example. Here data is collected that includes the month in which something occurred. A survey was created with the months as the options and the results were put into a dashboard. In the chart, they order alphabetically. In the following dashboard, I've filled out the survey 12 times, putting 12 points on the map, one for each month. Notice that the chart has the months alphabetized:

01-AlphabeticalChart.png

You can adjust this sort in the dashboard, but only to choose reverse alphabetical order.

Fix: Rename the values while authoring the survey

The easiest way to address this is to account for the display order of your choices while you are authoring your survey. Rename the values for the choices to start with a number, while leaving the displayed words alone. Let's see how:

  1. Add your choice question, either Single select, Single select grid, or Dropdown. Provide the choices, using the words that the person filling out the survey expects (for example, January, February, March, etc.).

    00-authoringChoices_numbered.png

     

  2. Save your survey, and click Publish to start the publish process.
  3. In the publish pane, click Modify schema
    Note: You can only do this before the question is published. After that, you can't rename the choices. After a question is published, you'd need to delete the question and re-add it to rename the choices. And if you already have collected data, it won't use the new question or naming.

    numberedClicksInS123Design.png

  4. In the Name column, click the value you need to change (for example, January or February).
  5. Pre-pend the word with a number.
    A best practice is to use "01_" for the first, "02_" for the second, and so on. The 0 lets you have more than 9 ordered choices. Although you've added numbers, they'd sort 1, 10, 11, 12, 2 (using the first digit and then the second when sorting, the same way alphabetizing is done). 
  6. Once all your values are updated, click Publish.
  7. Now when you use your data in a dashboard, the choices will sort according to the numbers you put before them.

Happily sorted dashboard charts!

Now when you put your data into a dashboard, the charts will sort how you'd like.

03-FixedChart.png

So plan ahead!

While it is always a best practice to plan your survey, remember that planning how you want to use the data is part of that planning. If you are going to make a dashboard, make a test one with fake data before you do all your data collection work. (A good way to get fake or test data is to fill out the survey a few times yourself; you can delete these records before your actual data collection.) Your test dashboard will help identify problem areas, like this one, that you can resolve by a tweak in your survey. And changes to your survey are a much easier solution before you've started collecting your data.

About the Author
Our kids need GIS in their problem-solving toolboxes. I'm working to get digital maps into each K-12 classroom and the hands of each child. A long-time Esri employee, I've previously worked on Esri's mobile apps, focused on documentation and best practices. Out of the office I'm a runner often found on the trails or chasing my children.