Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to select multiple values in a field with actions ?

Hi,

I'm trying to do something which seems very simple : I'm trying to select two or more values in a field. But I want to do this using actions (not Ctrl + Mouse button).

By example, suppose a Field 'MyField' such as :

LOAD * INLINE [
MyField
A
B
C
D
E
F
];

I just want to create an action which select B and E value. What is the correct syntax ?

Best regards

P.S : I'm working with QlikView 9 SR4 and SR5

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

It's not an idea, it's the solution Big Smile

Try this : '(2009|2010)'

In my case, I use an Input Box link to myVariable to enter a list of value : 2009,2010

And I used a button with to action (toggle button) with the following expressions based on myField:

1) = '(' & GetFieldSelections(myField, '|') & ')' // to remove existing selection

2) ='(' & Replace(myVariable,',','|') & ')' // to apply my selection

Sébastien Fatoux

View solution in original post

13 Replies
Pablo_Robles
Partner - Contributor III
Partner - Contributor III

Hi Bertrand,

You can create an action, in a button or any other object, that selects several values. Follow the next steps:

1. Create a button (or other object that supports actions)

2. Create an action 'Select in a field'

3. Type the name of the field for the selection in the Field box

4. Type the value for the selection in Search string box

If you want select other value mantaining the previous selection, add a new action with Alternate select. Follow the next steps:

1. Create another action in the same button type 'Alternate select'

Repeat steps 3 and 4 from initial selection.

¡Voilá!

Best regards,

Pablo

Not applicable
Author

Hello !

Thanks for your answer,

I'm sorry, I don't understand what do you mean with "a button type 'Alternate select' " ? (maybe the "toggle select" action??)

Anyway I would like to select several values with only one action because I don't know how many value I will have to select at a time (it's stored in another field).

the toggle select action seems to be a good idea :

"Toggles between the current selection and the specified Field and Search String. In the Search String you can specify a search mask, e.g. (A|B) will select both A and B."

That's exactly what I want to do !

But I don't manage to find to right syntax to use in the search string box (of Toggle select action).
If I want to select 2009 and 2010 in a field, I've tried many syntaxs (such as (2009|2010), 2009|2010, '2009'|'2010', (same with '=' before)). But it doesn't works

Is someone have an idea ?

Best regards

sunil2288
Creator III
Creator III

HI BErtrand,

You can create a bookmark upon selection you made and can define an action upon the bookmark.

Hope it can Help you..

Regards,

Sunil

Not applicable
Author

Thanks for your answer,

but that's not exactly what I'm looking for.

Your solution would works if I know which selection I'm gonna make and if these selections are statics, but it's dynamical.

Any other ideas ?

Not applicable
Author

Hi,

It's not an idea, it's the solution Big Smile

Try this : '(2009|2010)'

In my case, I use an Input Box link to myVariable to enter a list of value : 2009,2010

And I used a button with to action (toggle button) with the following expressions based on myField:

1) = '(' & GetFieldSelections(myField, '|') & ')' // to remove existing selection

2) ='(' & Replace(myVariable,',','|') & ')' // to apply my selection

Sébastien Fatoux

Not applicable
Author

You can try this.


='('&Concat(Distinct Num1,'|')&')'


See example.

Not applicable
Author

Hi, could you explain me the Distinct function?

I want to do your method this action but in my "Num1" I have strings. And ones are simple word but someone are a string of couple words, for example: Num1=[string1, string2, st ri ng3, str ing4]. And this function work, but for only values of one words (string1, string2). How Can I do that for all?

Not applicable
Author

Hi Cross

I have the same problem. But my values have a space in between their name. SO the logic

'(Product | Store Name)' is not working. What could be the possible solution

Anonymous
Not applicable
Author

You might've found the answer because this thread has been posted for awhile, but I'll give it a shot. If you have the space in between your values, try using double-quotes encapsulating those values, e.g.: ("Product"|"Store Name")

Cheers,

Anton