Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

momajasa
New Contributor

GetFieldSelections not triggering multiple selections as expected

Hi everybody,

I am trying to use the GetFieldSelections with the "Select in Field" Action to Trigger a selection in another Dimension with exactly the same values. (Before you wonder why I am doing this: It is used for a Special Business case where I need to compare two Fact Tables which cannot be linked due to insufficient Key Fields)

Anyways the action is triggering fine when single values are selected in the designated listbox, but as soon as several values are selected (at once or one by one with the ctrl-key Held) nothing happens. Eventhough the GetFieldSelections command is delivering the list of the selected values displayed in a text object.

Has anyone had a similar Situation and a Workaround?

Cheers,

MoMa

1 Solution

Accepted Solutions
sam_grounds
New Contributor III

Re: GetFieldSelections not triggering multiple selections as expected

I would try this in the action.

'('&Concat(FieldName,'|')&')'

...rather than GetFieldSelections(). That function will not give you the correct format for transferring into another selection.

What you want to be able to select is something like this

(Value1|Value2|Value3)

...GetFieldSelections() will give you something like this

Value1, Value2, Value3

Hope this helps.

Sam

6 Replies
sam_grounds
New Contributor III

Re: GetFieldSelections not triggering multiple selections as expected

I would try this in the action.

'('&Concat(FieldName,'|')&')'

...rather than GetFieldSelections(). That function will not give you the correct format for transferring into another selection.

What you want to be able to select is something like this

(Value1|Value2|Value3)

...GetFieldSelections() will give you something like this

Value1, Value2, Value3

Hope this helps.

Sam

momajasa
New Contributor

Re: GetFieldSelections not triggering multiple selections as expected

Awesome, it works. Thanks sam..

I have a further issue with the values containing spaces. They do not get selected. Can solve that with the Trigger command or do I have to remove the spaces from the value strings completely?

antoniotiman
Honored Contributor III

Re: GetFieldSelections not triggering multiple selections as expected

Hi Mahdi,

try this

='('&Concat(DISTINCT Chr(34)&FieldName&Chr(34),'|')&')'

Regards,

Antonio

sam_grounds
New Contributor III

Re: GetFieldSelections not triggering multiple selections as expected

Hi Mahdi,

No problem at all.

Yes, if they have spaces they need to have double quotes I believe.

It gets a bit messy, but you could use something like this...

Concat("Value With Space"|Value|Value|"Other Value With Space")

So as an expression, if you do this...

'("'&Concat(FieldName,'"|"')&'")'

...it should work.

momajasa
New Contributor

Re: GetFieldSelections not triggering multiple selections as expected

This works just fine ... I wish I could mark both of your answers as correct :-/

Thanks a lot guys!

antoniotiman
Honored Contributor III

Re: GetFieldSelections not triggering multiple selections as expected

No problem.

I'm glad to have helped You.

Regards,

Antonio