Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filter based on Keyword

Hi

I fairly new in Qlik, & through this community, I have been able to pass a lot of problems. But I am stuck here.

In my files, I have sales from Virginia as VA_ZIPCODE, & Newyork_ZIPCODE. I want to have a functionality, where I can see data from Virginia all zip codes or Newyork based on keywords Virginia, & Newyork.

Filter should have option to select Virginia or Newyork

Can you help in creating filter based on Keyword. Your help in this regard is highly appreciated.

8 Replies
rittermd
Master
Master

Possibly you could break apart the names of the states prior to the _ and put that in a separate field in your script.

Then use this new field as your filter in the app.

Not applicable
Author

I am already using Pipe as separator for columns. Cannot have 2 separators. Is their other way without changing base files.

jmvilaplanap
Specialist
Specialist

Hi

I think, the best way is to have a map with all the postcodes and states, for example

MAP_States:

Mapping

LOAD * Inline [

ZIP, State

1, NY

2, NY

3, VA

];

And later, in your table add this map

LOAD

     *,

     ApplyMap('MAP_States', ZIPField)          AS State

...

...

...

Or maybe there is a pattern to know is a ZIP code is from a state or another

Not applicable
Author

  If you can help me with following question, it will help in similar way.

Below column of projects is with name Market or Metro. The other parameter can vary. If I select Market then selection will be for Market projects & if I select Metro then it will be all Metro Projects selected.

Market_2017-D1
Market_2017-D2
Market_2017-D7
Market_2017-D8
Market_2017-D1
Market_2017-D1
Market_2017-D1
Market_2017-D1

Market_2017-D1

   

Metro_2016-2H - 1
Metro_2016-2H - 1
Metro_2016-2H
Metro_2016-2H
Metro_2016-2H_02
Metro_2016-2H_02
Metro_2016-2H_02
Metro_2016-2H_02

jmvilaplanap
Specialist
Specialist

if(wildmatch(subfield(projects, '_'), 'Metro'), THIS IS FOR METRO, THIS FOR MARKET)

Not applicable
Author

Thanks a lot, It worked for me

If(WildMatch(Project,'*Metro*'),'Rootmetrics',If(WildMatch(Project,'*Market*'),'Nielson','Other'))

jmvilaplanap
Specialist
Specialist

My pleasure.

Could you mark the responses as helpful or correct?

Thanks

ogster1974
Partner - Master II
Partner - Master II

Just so you know you could have loaded your data as it is then in the search bar and start typing market in the project field and qlik would filter the selections for you. 

You only need to formalise your filter category if you want to use it as a fine soon otherwise qlik helps the user alot.