Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
MRitter
Employee
Employee

A Filter question

In my app I have 2 tables that are not associated by design.  However, they share fields with the same values and I would like to create a single filter that will affect the visualizations for both tables.

For example:

Claims table has a field called Industry with a set of values I have created.

Policy table has a field called Policy Industry that contains the same set of values.

I can not associate these 2 tables directly as they have no relationship in the data.  

I would like a single filter in the app called Industry with these values as choices.  If a user selects an Industry it will filter both the claims sheet and the policy sheet.  I want to avoid 2 separate filters for Industry and make the user select 2 times.  If that is possible.

1 Reply
petter
Partner - Champion III
Partner - Champion III

You can have a data island table which has a single field that you can use for selection and filtering. The field could be called SelectedPolicy. The table should contain all possible distinct values from both of the data tables.

When you create visual tables or other visualizations you will have to use a set expression to include the values from the data island table that you might call SELECT_POLICY.

 

SELECT_POLICY:
LOAD DISTINCT Policy AS SelectedPolicy RESIDENT Claims;
LOAD DISTINCT [Industry Policy] AS SelectedPolicy RESIDENT Policy;

 

The set expression to include in all the aggregations function that you want to be affected by the filter would look like this:

For visualizations using the Claims table you would include this set expression within all the measures and their aggregation functions:
{<Policy={'$(=Concat(SelectedPolicy,'',''))'}>}

be aware that '' is two consecutive single quote characters and not a single double quote character above.

For visualizations using the Policy table you would include this set expression:
{<[Industry Policy]={'$(=Concat(SelectedPolicy,'',''))'}>}

 

It could look like this:

=Sum( {<Policy={'$(=Concat(SelectedPolicy,'',''))'}>} Amount )

[ NOTE: to show any contributor that you like and appreciate their answers please CLICK the like icon (thumbs up) ]