Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select in Field, Search String (Variables)

I am storing my current selections in to variables for some of my fields(MultiBox A). for example,

vGetSelect = '(' & GetFieldSelections(Products_A, '|') & ')' Pipe as a delimiter

The above SetVariable code will get all the selected values from Products_A and assign it to vGetSelect.

for example at one instance; vGetSelect = (Car|Truck|RV|Big Truck|Small - Car|Bike)

The reason I do this is I want to clear Products_A(one of the field in MultiBox A) upon a switch to (MultiBox B)and then bring it back upon switching back to MultiBox A.

This is what I am doing. When I switch back to 'MultiBox A', I have an actions "Select In Field" "Products_A" but not sure what should I put in "Search String". How can I use search string to bring back all the selections made in Products_A?

6 Replies
johnw
Champion III
Champion III

For some reason, I've just never had any luck using the pipe delimiter when searching for multiple values, even though it's supposed to work fine. So I think I've done it something like this (taking advantage of advanced searching):

=match(Products_A,$(vGetSelect))

However, if you do end up going that way, you'd have to change the definition of vGetSelect to be a quoted and comma separated list. I think this:

vGetSelect = chr(39)&getfieldselections(Products_A,chr(39)&','&chr(39))&chr(39)

I probably got some of the specifics wrong, as it seems like every time I try to do an advanced search in an action I need to remind myself of the stupid syntax, but I suspect that something like that would work once you get the syntax nailed down.

Better to get the pipe approach working, of course, since that's how it's supposed to work.

Not applicable
Author

John,

Pipe delimiter doesn't work for me either. I am going forward with your approach. However, Field values in my case contain lots of '-' dashes and blank spaces. For example, GeoField might have

MIDWEST - EAST NORTH CENTRAL

MIDWEST - WEST NORTH CENTRAL

For me MIDWEST - EAST NORTH CENTRAL by itself works. However, if I search (multiple values) i.e.

'MIDWEST - EAST NORTH CENTRAL','MIDWEST - WEST NORTH CENTRAL' it don't work. Any solution?



johnw
Champion III
Champion III

Dashes and blank spaces shouldn't be an issue since we're putting the values in single quotes.

As best I can tell, using advanced search in a selection action requires you to build the expression as a string instead of just putting the expression there, so that's probably the problem. So maybe change your search expression to this? It seemed to work for me for something similar to what you're doing, but not exactly what you're doing, so it might need further tweaks.

='=match(Products_A,' & vGetSelect & ')'

Not applicable
Author

[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/2112.geo_5F00_Align.zip:550:0]

Attached is the zip file to sample application. When User makes selection in Geo Multibox and then switches to Sales. Following events needs to happen.

1. Save all current Geo selections into a variable.

2. Clear all the geo selection(as they are mutually exclusive) Once user switches back to Geo following needs to happen

3. Save all currnet Sales selection into variables

4. Clear all Sales selection

5. re-apply previous geo selections.

Not applicable
Author

Apologies for the zip file. Here's the QVW file.

chetanpatel
Contributor III
Contributor III

used below  equation and  it's  work for  me for  selecting last two month

=('('&Left(MonthName(today(),-1),3) &'|' &Left(MonthName(today()),3)&')')