Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
jerryr125
Creator III
Creator III

Pivot Table - Sort with expression - Dimension Value

Hi -

I am using the Pivot Table Visualization.

I am using a column dimension  - "Category Name".

I would like to sort the column dimension in a specific order.

I created a sorting - by expression using the following:

Pick([invcatid],'ma','cg','sg','hs')

(the 'ma','cg','sg','ms' is the only inventory categories valid).

It does not sort accordingly - any thoughts ? Thanks - Jerry

1 Solution

Accepted Solutions
Seyko
Partner - Creator
Partner - Creator

Hello Jerry,

You can modify the default order of values on this field directly in the script editor :

  •  Create an inline table which contains the values in the order intended
// Values with desired order 
TMP:
LOAD * INLINE [
invcatid
ma
cg
sg
hs];

// Here, we've your final table which contains concerned dimensions
MyTable:
LOAD
invcatid,
*
RESIDENT TAB;

// Drop table
DROP TABLE TMP;​
  • After that, the field invcatid take the 'good' order. Now, you can use this field in sort part (by expression). 

Tell us if it works.

Regards

Excuse my english, i'm french!

View solution in original post

1 Reply
Seyko
Partner - Creator
Partner - Creator

Hello Jerry,

You can modify the default order of values on this field directly in the script editor :

  •  Create an inline table which contains the values in the order intended
// Values with desired order 
TMP:
LOAD * INLINE [
invcatid
ma
cg
sg
hs];

// Here, we've your final table which contains concerned dimensions
MyTable:
LOAD
invcatid,
*
RESIDENT TAB;

// Drop table
DROP TABLE TMP;​
  • After that, the field invcatid take the 'good' order. Now, you can use this field in sort part (by expression). 

Tell us if it works.

Regards

Excuse my english, i'm french!