Get Free Trial

How to make the pivotgrid sort by members as numbers not as strings

mstrukov asked on August 11, 2016

We have a few dimensions with numeric members and we would like pivotgrid to sort them as numbers not as strings.
For example, the members values are 1, 2, 10, 12. If we sort them from A to Z the result is 1, 10, 12, 2. That is the sort is done as if the values were strings.
The sort result we expect is 1, 2, 10, 12. Is ther eanything we can do to achieve this? 
Note we use flash pivot grid version with CSV datasource.
Thank you!

4 answers

Dmytro Zvazhii Dmytro Zvazhii Flexmonster August 12, 2016

You should define dimension as numeric
Please find sample here:

Does it work for you?

mstrukov August 19, 2016

We use a config file to set up report metadata. Is there a config file example?

Iryna Kulchytska Iryna Kulchytska Flexmonster August 22, 2016

Hi Maxim,
The above sample was for JSON data source. Here I will explain you how to define data types in CSV.
Please note that the indication whether the dimension’s members are numeric or string should be done in CSV, not in a config XML file. This can be done by using prefixes in the first CSV row. For example, “m+” prefix indicates that the field is a month:


The fields “amount”, “index” and “year” will be considered by the component as numeric automatically, based on the first members. There are some cases when you need to indicate that the field is numeric explicitly, for example, when the member in the first data row in CSV in null. In this case, “-” prefix should be used, as follows:


More details about CSV data types can be found in the documentation
Please let me know if the above approach works for you.
Kind regards,

mstrukov August 22, 2016

Hi Iryna,
Thanks for you answer I will give it a try soon

Please login or Register to Submit Answer