Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select exclude for the given values

I ve a field 'ID ' which has values as (a,b,c,d,......). Here I want to select all the values other than a & b using an action in a button.

Using the 'Select in Field' action on ID  field, I tried <>(a|b) expression , which is not working.I could do it using two actions 'Select in Field, Select Excluded' on the ID field.

Is it possible to do it using single action.

Thanks,

Sankar

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

You can use this expression there (including the = sign)

='('& concat({<ID-={a,b}>} distinct ID, '|')& ')'

This will construct a string will all the values, excluding A,B. : (c|d|e|f)

A bit complicated expression to a task that could be done with two actions...

Hope this helps,

Erich

View solution in original post

5 Replies
erichshiino
Partner - Master
Partner - Master

You can use this expression there (including the = sign)

='('& concat({<ID-={a,b}>} distinct ID, '|')& ')'

This will construct a string will all the values, excluding A,B. : (c|d|e|f)

A bit complicated expression to a task that could be done with two actions...

Hope this helps,

Erich

Not applicable
Author

How about:

Select in Field: Field     (A|B)

Select Excluded: Field

Not applicable
Author

Hi Erich,

Thanks for the solution.

One more requirement to select 'aa aa' |'bb bb' in the ID field using the action in the trigger.Due to the space b/w the words , usual expression - (aa aa|bb bb) is not working.

dhruv_sampat
Contributor
Contributor

Hi Erichshiino,

When i used your expression, added it to a button and using "Select in field" and then added an Exclude so i can confirm that only those 2 are being excluded, it seems to be picking the first valid value alphabetically and then excluding it as well as the two in the expression.

e.g. 

='('& concat({<BPR_0-={'GBI-103658','GBI-102288'}>} distinct BPR_0, '|')& ')'

and it excluses " ", "Axxx", 'GBI-103658','GBI-102288' which i cant figure out why.

Please assist.

BrunPierre
Partner - Master II
Partner - Master II

='('& concat({<BPR_0-={"GBI-103658","GBI-102288"}>} distinct BPR_0, '|')& ')'