How to make the pivotgrid sort by members as numbers not as strings
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.
You should define dimension as numeric
Please find sample here: https://jsfiddle.net/yc3vto22/7/
Does it work for you?
We use a config file to set up report metadata. Is there a config file example?
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 http://www.flexmonster.com/doc/data-types-in-csv/
Please let me know if the above approach works for you.
Thanks for you answer I will give it a try soon