Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Jaeger
Contributor II
Contributor II

Sorting of GetFieldSelections()

Hi,
there are some posts but no one gives the satisfying solution to my problem:
I habe a table with a sort and a name
MyData:
Load * Inline
[MySort,MyName
10,"AA"
11,"AB"
12,"AC"
13,"BC"
14,"BB"
15,"BA"
];

If I add a FilterPane to the Sheet with the MyName in Data and I select multiple items then they are getting sortet alphabethically (not load order or something else) with the following expression:
=Trim(GetFieldSelections(MyName))

E.g. if I select AA, BC, BA then the result would be AA, BA, BC but according to the MySort I want to get AA, BC, BA.

Could you tell me the exact expression to get that result, please?

Thanks for any help, it's highly appreciated!

Labels (1)
1 Solution

Accepted Solutions
Jaeger
Contributor II
Contributor II
Author

Got it 😀:
Concat(DISTINCT MyName,',',MySort)

View solution in original post

2 Replies
Or
MVP
MVP

The only reasonable way I can think of to achieve this for GetFieldSelections is to use Dual(MyName, MySort) as your field.

If you're not too attached to GetFieldSelections(), you could also use Concat() instead, since that allows for sorting. You can throw in something like If(GetSelectedCount(Fieldname)>0,Concat(Fieldname)) to only return values if selections have been made.

Jaeger
Contributor II
Contributor II
Author

Got it 😀:
Concat(DISTINCT MyName,',',MySort)