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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
priscilarubim
Partner - Contributor III
Partner - Contributor III

How to create a filter field that includes/excludes a specific category associatively?

Hi community,

I would like to know what the best approach would be to create a filter field called [Region] that works as follows:

 

- Include All Regions - displays all region categories (NA, EU, APAC, LATAM, MEA)

- Exclude APAC - displays all regions except APAC

Labels (3)
4 Replies
RafaelBarrios
Partner - Specialist
Partner - Specialist

Hi @priscilarubim 

If you're referring to script execution, I would suggest first creating an inline table and then using a join to reduce the table containing the regions. This way, you don't waste time filtering while reading the source or the QVD.

DATA:
load * inline [
Region
NA
EU
LATAM
MEA];

LEFT JOIN (DATA)
LOAD
   Region
   <your other fields>
FROM <database|qvd>;


If you are refering to expressions to limit the results of a table or chart:

sum({< Region-={"APAC"} >} quantity)


This way you can use APAC on some other sheet in the same app.

Hpe this helps.
best,

help users find answers! Don't forget to mark a solution that worked for you & to smash the like button! 

priscilarubim
Partner - Contributor III
Partner - Contributor III
Author

Hi Rafael, thanks for your response!

What I need is a filter pane with two selectable options that control which categories are visible in the app:

Region Filter:
- > Include All Regions:  NA, EU, APAC, LATAM, MEA 
- > Exclude APAC:  NA, EU, LATAM, MEA 

So when the user selects "Include All Regions", all categories are shown. When they select "Exclude APAC", all categories are shown except APAC.

The challenge is that NA, EU, LATAM and MEA need to belong to both filter options simultaneously.

I am considering using a Bridge Table to handle this, but I am not sure if that is the most elegant approach. 

Thanks!

RafaelBarrios
Partner - Specialist
Partner - Specialist

got it,

here a quick example with different data, but im sure you will get the idea

you can do it with two button objects

RafaelBarrios_0-1778103253915.png


drag and drop a button and click on "add action"

RafaelBarrios_1-1778103342273.png

 


with one button you can apply selections on a field for one or several values

RafaelBarrios_2-1778103413593.png

 

the other button, will clear the selections on a field, showing everything

RafaelBarrios_3-1778103466765.png


hope this helps

Best,

 

marksouzacosta

Hi @priscilarubim,

Do the "bridge" table. You just need to classify those records.

One suggestion is to create a single selection only, like the example below:

Regions:
LOAD 
Region,
If([ExcludeAPAC]=1,'Exclude APAC') AS [Region Filter]
INLINE [
Region, ExcludeAPAC
NA,
NA,1
EU,
EU,1
APAC,
LATAM,
LATAM,1
MEA,
MEA,1
];

 

This is how it will look in the Dashboard:

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com