Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
lrenwick
Contributor III
Contributor III

Filter on a multi picklist

I have a field which is a multi-pick list so when I apply a filter it looks like;

Brand
WFI
NFI;PFI
PFI
WFI;NFI;JFI
JFI
NFI

 I would like to group the filters so all organisations operating under the NFI brand are highlighted when selected regardless of what other brands they are also attached to. Is there a way to do this in the filter pane?

Labels (2)
1 Solution

Accepted Solutions
Gysbert_Wassenaar

You can script it

NewFilter:
LOAD
    Brand, SubField(Brand,';') as BrandFilter
RESIDENT
    TableWithBrandField
    ;

talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar

In the filter pane click on the magnifying glass icon to open the search box. There enter *NFI* as search string and press enter. That should highlight all the brands containing the string NFI

talk is cheap, supply exceeds demand
lrenwick
Contributor III
Contributor III
Author

Is there a way to tidy up the filter list so each brand only appears once rather than each combination appearing?

Gysbert_Wassenaar

Yes, by creating an extra table in the script with a new field that you can use for the filter pane:

NewFilter:
LOAD * INLINE [
Brand, BrandFilter
WFI, WFI
NFI;PFI, NFI
NFI;PFI, PFI
PFI, PFI
WFI;NFI;JFI, WFI
WFI;NFI;JFI, NFI
WFI;NFI;JFI, JFI
JFI, JFI
NFI, NFI
];

talk is cheap, supply exceeds demand
lrenwick
Contributor III
Contributor III
Author

What if there's thousands of different combinations? Is there a easier way of scripting this, maybe using wildmatch?

I tried the below but it looks like incorrect syntax. 

NewFilter:
LOAD*INLINE [
Brand, BrandFilter
if(wildmatch([Brand__c],'*NFI*', 'NFI')

Gysbert_Wassenaar

You can script it

NewFilter:
LOAD
    Brand, SubField(Brand,';') as BrandFilter
RESIDENT
    TableWithBrandField
    ;

talk is cheap, supply exceeds demand
lrenwick
Contributor III
Contributor III
Author

Thank you, this helped!