Sort on inactive dimensions


we offer our users pre-defined reports with inactive dimensions they can activate at their convenience. This works great and we are quite happy. But unfortunately we can not pre-define the custom-sorting on measures. In our example below ‘L4L’ is properly sorted, but if a user adds ‘Day of Week’ as row or column it get sorted alphabetically. What is the best way to deal with it?
Thanks in advance for your support.

rows: [
{uniqueName: "L4L", customSorting: ["Existing", "New", "Closed"]},
{uniqueName: "Country"},
{uniqueName: "Own-Store"},
{uniqueName: "Retailmanager", active: false},
{uniqueName: "Store"}
columns: [
{uniqueName: "[Measures]"}
measures: [
uniqueName: 'Day of Week',
calculated: false,
caption: 'Day of Week',
customSorting: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
active: false
uniqueName: 'CS',
calculated: false,
aggregation: 'sum',
caption: 'Consumer Sales',
format: 'euro',
active: true
uniqueName: 'CS NET',
calculated: false,
aggregation: 'sum',
caption: 'Consumer Sales',
format: 'euro',
active: false

1 answer

Iryna Kulchytska Staff October 12, 2016

Hi Jan,
Thank you for writing your question here.
The property customSorting works for hierarchies in rows, columns and pages. Unfortunately, it does not work in measures.
I have prepared a sample for you that illustrates how the days of the week can be sorted properly The component supports the sorting of months and the days of the week. The sample is based on JSON data and the first element of the JSON is used to define the data types:

"L4L": { type: "string" },
"Country": { type: "string" },
"Store": { type: "string" },
"Day of Week": { type: "weekday" },
"CS": { type: "number" },
"CS NET": { type: "number" }

More details about data types in JSON can be found in the following article in the documentation If your data source is CSV, please read about defining the data types in CSV
By default, the days of the week are sorted according to the following order: “Sunday”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”.
This order can be changed in a localization file. The following line in the sample defines the localization for the report:

localSettingsUrl: ""

Inside the localization file the block <weekdays> defines the following order: “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”, “Sunday”.
If you need to pre-define the custom-sorting for hierarchies that have string data, like “L4L”: { type: “string” }, you need to select them for rows, columns or pages.
Please let me know if the above information was helpful.
Kind regards,

Please login or Register to Submit Answer