Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've a chart with several value in dimension, takes for instance :
Dimension | Value |
---|---|
A | 1 |
Other | 1 |
C | 1 |
D | 1 |
B | 1 |
I would like to sorting values in order to have :
Dimension | Value |
---|---|
A | 1 |
B | 1 |
C | 1 |
D | 1 |
Other | 1 |
Infact, I would like to put "Other" at the end. I can't manage the script, so I have to find a solution into properties of chart.
I can't use the alphabetical order, I believe I have to choose the expression order but I have no idea about which function I can use.
Does anyone has an idea ?
Thanks,
Regards,
Marine Le Trionnaire
I guess you neither want to hard code all possible values in your sort expression, nor will "Other" be your last alphabetical value.
Therefore I tried to build a generic expression for sorting:
I tried this one for the following Inline Table:
if(Dim <> 'Other', Ord(Dim), max(TOTAL Ord(Dim) + 1))
where Dim is your actual Field name for the dimension. Just put this expression in the sort expression field and decide wehter to sort it ascending or descending.
!
Table:
LOAD * INLINE [
Dim, Val
A, 1
Other, 1
Z, 1
C, 1
D, 1
B, 1
];
Patrick
Try match function in sort tab-->Expression
Match(Dimension,'A','B','C','D','Other')
Is "Other" a real value of this dimension or just the cumulation of all values but the first 4?
Try:
WildMatch(Dimension,'A','B','C','D','Other')
Can you share your app if this method do not work?
Hi,
try to
sort your dim asc by expression if(Ord(Dimension)<91, Ord(Dimension), 100).
M
HI,
For best you can recreate your Dimension in script
Try like this
If(Field='A',dual('A',1),
Field='B',dual('B',2),Field='C',dual('C',3),Field='D',dual('D',4),Field='Other',dual('Other',5))
Hi,
No need any expression To ur requirement.Simply Go to properties>>Sort>>Enable Text as A-Z.
This is enough for to solve this
Let me know getting solve or not ?
Regards,
Nagarjuna
Hi,
Kindly find below attached file.
I guess you neither want to hard code all possible values in your sort expression, nor will "Other" be your last alphabetical value.
Therefore I tried to build a generic expression for sorting:
I tried this one for the following Inline Table:
if(Dim <> 'Other', Ord(Dim), max(TOTAL Ord(Dim) + 1))
where Dim is your actual Field name for the dimension. Just put this expression in the sort expression field and decide wehter to sort it ascending or descending.
!
Table:
LOAD * INLINE [
Dim, Val
A, 1
Other, 1
Z, 1
C, 1
D, 1
B, 1
];
Patrick
Thanks for your answer.
It seems to be right but I would like to be sure I've really understand how to use this function :
I put it : Match(Dimension,'Other') because the others values could be differents. Sometimes A,B,C, or sometimes M,X... so I can't put A,B,C,D... in this function.
Does this function sorted only values which are mentionned ? For the other values I can add an alphabetical order.
Is it right ?
Thanks,
Marine Le Trionnaire