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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Prudhviqliks
Contributor II
Contributor II

Joins display by filter

Hello Qlikies,

I want one solution for my scenario, I have 3 tables and my requirement is that , i will create one filter and in filter when i click on left join then only left join output will have to display , and same like when i click on right join then only the right join output has to display . How to achieve this , Hope i will get an answer here, Thanks .

Qlik Sense Business  Qlik Sense Desktop #qlik

1 Solution

Accepted Solutions
Sayed_Mannan
Creator II
Creator II

Interesting question and here is my step by step solution:

1. Create a Filter for Join Type: Create a field in your data model that specifies the type of join (e.g., 'Left Join', 'Right Join', 'Inner Join')

2. Load Data with Conditional Joins: Use the 'IF' statement in the Data Load Editor to conditionally load data based on the selected join type.

3. Set Variable for Join Type: Create a variable 'vJoinType' that captures the selected join type from the filter.

4. Create Filter Pane: Add a filter pane in your Qlik Sense app for the `JoinType` field to allow users to select the type of join.

Here's a detailed example:

# Step by Step Sol

1. Create Join Type Filter:

JoinType:
LOAD * INLINE [
JoinType
Left Join
Right Join
Inner Join
];

2. Load Tables:

// Load Table1
T1:
LOAD
Key,
Field1,
Field2
FROM [lib://path/to/Table1.xlsx];

// Load Table2
T22:
LOAD
Key,
Field3,
Field4
FROM [lib://path/to/Table2.xlsx];


3. Conditional Joins:

// Conditional Join based on filter selection


IF '$(vJoinType)' = 'Left Join' THEN
LEFT JOIN (T1)
LOAD
Key,
Field3,
Field4
RESIDENT T2;
ELSEIF '$(vJoinType)' = 'Right Join' THEN
RIGHT JOIN (T1)
LOAD
Key,
Field3,
Field4
RESIDENT T2;
ELSEIF '$(vJoinType)' = 'Inner Join' THEN
INNER JOIN (T1)
LOAD
Key,
Field3,
Field4
RESIDENT T2;
ENDIF

4. Create Variable:
- Go to the Variables section in Qlik Sense.
- Create a new variable named 'vJoinType'.

5. Set Variable Value:
- Use a button or input box to set the value of 'vJoinType' based on user selection.

6. Create Filter Pane:
- Add a filter pane in your Qlik Sense app for the 'JoinType' field to allow users to select the type of join.

 

If this helps please mark this as a solution.

 

Cheers,

Sayed Mannan Ahmad

 

View solution in original post

3 Replies
Sayed_Mannan
Creator II
Creator II

Interesting question and here is my step by step solution:

1. Create a Filter for Join Type: Create a field in your data model that specifies the type of join (e.g., 'Left Join', 'Right Join', 'Inner Join')

2. Load Data with Conditional Joins: Use the 'IF' statement in the Data Load Editor to conditionally load data based on the selected join type.

3. Set Variable for Join Type: Create a variable 'vJoinType' that captures the selected join type from the filter.

4. Create Filter Pane: Add a filter pane in your Qlik Sense app for the `JoinType` field to allow users to select the type of join.

Here's a detailed example:

# Step by Step Sol

1. Create Join Type Filter:

JoinType:
LOAD * INLINE [
JoinType
Left Join
Right Join
Inner Join
];

2. Load Tables:

// Load Table1
T1:
LOAD
Key,
Field1,
Field2
FROM [lib://path/to/Table1.xlsx];

// Load Table2
T22:
LOAD
Key,
Field3,
Field4
FROM [lib://path/to/Table2.xlsx];


3. Conditional Joins:

// Conditional Join based on filter selection


IF '$(vJoinType)' = 'Left Join' THEN
LEFT JOIN (T1)
LOAD
Key,
Field3,
Field4
RESIDENT T2;
ELSEIF '$(vJoinType)' = 'Right Join' THEN
RIGHT JOIN (T1)
LOAD
Key,
Field3,
Field4
RESIDENT T2;
ELSEIF '$(vJoinType)' = 'Inner Join' THEN
INNER JOIN (T1)
LOAD
Key,
Field3,
Field4
RESIDENT T2;
ENDIF

4. Create Variable:
- Go to the Variables section in Qlik Sense.
- Create a new variable named 'vJoinType'.

5. Set Variable Value:
- Use a button or input box to set the value of 'vJoinType' based on user selection.

6. Create Filter Pane:
- Add a filter pane in your Qlik Sense app for the 'JoinType' field to allow users to select the type of join.

 

If this helps please mark this as a solution.

 

Cheers,

Sayed Mannan Ahmad

 

Kushal_Chawda

@Prudhviqliks  Please share sample data of 3 tables and expected output

Prudhviqliks
Contributor II
Contributor II
Author

Thank you @Sayed_Mannan , it works and i hope it will clear and help to all users which have the same question.