Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi folks,
I have a chart in which I would like the way to sort being selected by the users.
The chart displays this data
Table1:
LOAD * INLINE [
dim1, value
A1, 10
A1, 1
A1, 11
B1, 2
B1, 36
C1,3
];
I created a small inline table holding the name of the sorting-approach and the actual expression.
Like this:
SortTable:
LOAD * INLINE [
sortName,sortExpr2
Value, sum(value)
Count,count(DISTINCT value)
Default,''
];
Then I present the sortName-dimension in a listbox and would like to set the corresponding sortExpr2 as the sorting expression.
I tried this as the sort-expression in the chart:
Only({<sortName = {$(=GetfieldSelections(SortName))}>} sortExpr2)
but currently it doesn't even work in a text-box.
(I also tried with a cyclic dimension and the function-call replaced by getCurrentField(CyclicDim) and by then the expression above worked in a text-box but not as the sort-expression in the chart)
I've been fidling with this for hours and would like som help on the topic. What I'm I doing wrong?
I attach a very small example-application.
brgds
Andy
=$(=only(sortExpr2)) seems to work, though I'm not sure how you could do the default selection.
See attached.
Jonathan
=$(=only(sortExpr2)) seems to work, though I'm not sure how you could do the default selection.
See attached.
Jonathan
Great!
Thanks.
I solved the default like this (just setting the expression to an empty string)
=if(only(sortName)<>'Default',$(=only(sortExpr2)),'')
/Andy