Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a dimension of Name, and this will only ever contain 4 names. It is set in stone.
I do not want to order in alphabetical order, either ascending or descending. I need to order specifically.
e.g. B,A,Z,Y
How can I do this with an expression?
go to sort tab and in expression:
if(NAME='B',1,if(NAME='A',2,if(NAME='Z',3,4)))
HTH
Sushil
Hi,
There are two ways you can do this.
1. Define the sorting in Script :-
Create a table which is link to your table with sort order. Something like below.
Data:
Load Name from Abc;
Sorting:
Load * inline [
Name, Sorting
B,1
A,2
Z,3
Y,4
];
Then in sort window click on the expression and type the field name as Sorting.
2. IN expression it self.
Some thing like this.
if(Name = 'B',1,
if(Name = 'A',2,
if(Name = 'Z',3,
if(Name = 'y',4))))
Hope this is clear.
Regards,
Kaushik Solanki
use in the sort tab the following expression:
=match(Name,'B','A','Z','Y')
Hi,
If you have lot of values then following Koushik's first solution
1. Define the sorting in Script :-
Create a table which is link to your table with sort order. Something like below.
Data:
Load Name from Abc;
Sorting:
Load *
inline [
Name, Sorting
B,1
A,2
Z,3
Y,4
];
Then in sort window click on the expression and type the field name as Sorting.
If you have less values then you can use this
=match(Name,'B','A','Z','Y')
in Sort -> Expression.
Hope this helps you.
Regards,
Jagan.
Thanks, exactly what I was looking
Hi,
I tried all of this but isn't working
if([Pi Py Jan Affluence new]='<100k',1,if([Pi Py Jan Affluence new]='100k-250k',2,if([Pi Py Jan Affluence new]='250k-1M',3,if([Pi Py Jan Affluence new]='1-3M',4,if([Pi Py Jan Affluence new]='3M+',5,if([Pi Py Jan Affluence new]='Established Not New',6,7))))))
I don't understand where I am going wrong. The sorting isn't working and I am using a people chart