How to define order/sort for JSON data

How can I define a specific order to display rows in? I a custom  order I want the rows to display in, which I was previously doing using the following method in the XML configuration.

<member>Display first</member>
<member>Second row</member>
<member>000 Display third</member>

We’ve since moved to the more efficient JSON configuration and can’t quite find how to replicate this feature …

5 answers

Iryna Kulchytska Staff August 3, 2016

Hi Ash,
Here is a sample of how to set custom sorting for hierarchy members in JSON report:
In report object when you define rows/columns, please specify customSorting array for the hierarchy, as follows:

var report = {
  data: jsondata,
  viewType: "grid",
  rows: [{uniqueName: "Color", customSorting: ["green", "yellow", "red", "blue"]}],
  columns: [{uniqueName: "[Measures]"}],
  measures: [{uniqueName: "Price"}]

Please let me know if it works for you.
Kind regards,

ash August 10, 2016

That seems to be exactly what I need. I’m having one issue with it, it only seems to work if what you’re attempting to sort on is all lowercase characters.
Example of what I’m trying to do here:
Same Example of it working with only lowercase characters: 
Any help appreciated!

Dmytro Zvazhii Staff August 10, 2016

Hi Ash,
Thank you for reporting this issue. We have reproduced it on our side. The fix will be available in the next minor release version 2.219 ETA Aug15.
Best regards,

ash August 11, 2016


We have a release to do late next week using this feature, so please let me know if there will be any delays!


Iryna Kulchytska Staff August 11, 2016

Hi Ash,
The fix will definitely be included into the next minor release 2.219 that will be available on Aug 15.
Kind regards,

Please login or Register to Submit Answer