Regarding the order of analysis

Originally the X-axis was displayed as “1,2,3,4…17,18,19,20”.
It was changed to “1,10,11,12,12,13… . 6,7,8,9”.
This graph gets its legend from the column names in the table, so the field names were changed to “101,102,103… .118,119.120”.
However, the “101,110,111,112… .107,108,109” in that order.

I do not know what is the basis for the alignment.
Please let me know if there is a way to arrange them in numerical order.

Hello @da-noguchi,

I assume that the field you are using for the x-axis is a string. Is that correct?

Previously, there was some “magic” sorting for strings in the old visualizations, which was helpful in some cases but not in others. Now, strings are always sorted following the standard of character sorting.

In your case, the solution would be to create an additional integer or number field that stores your values 1, 2, 3, … and use that for the x-axis instead of the string you are currently using. This will sort the values numerically on the x-axis. As all the strings end in “Average”, this will also make the axis less crowded. Additionally, you can customize the x-axis title in the new formatting panel and add the “average” to it if you don’t want the actual field in the table to be called “Average” or are using an expression to get to the value.

Best, Stefan

@da-noguchi One addition here:

If all your values end with " - Average" you could also replace the x axis value by the following expression which should give you the numbers in the right sorting.

texttointeger(substitute(<your field>, ' - Average', ''))

In addition you can add a customer x axis title stating that the values are the averages.

@stefan

Thank you for your response.
Unfortunately, the field used for the X axis is numeric.
I just want them to be lined up in order 100-120 from left to right on the x-axis.

Hey @da-noguchi,

Did you find any solution for this? I having a similar problem… I am trying to track performance month by month but because of string and different year it is not coming in proper order.

Thanks,
Amir

Hi @AmirPatel ,

No solution has been found yet.
The graph I showed the other day remains the same.

Hello @stefan,
Do you have an update on this?

@da-noguchi Can you send me a link to the analysis to stefan(at)tulip.co? I’d like to take a look at what the data and the analysis you built looks like.

@AmirPatel What approach are you using to get the month-by-month data? If you use the “Group By” feature available for timestamps, the axis should be sorted by time. See example below.

@stefan I have column in my table which indicates month and a year data belongs to which is in text format. (I am not collecting data from any equipment)

@AmirPatel Understood. In that case you should be able to convert that to a datetime datatype with the texttodatetime() expression which should result in the correct sorting.