Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
GHasan
Contributor III
Contributor III

Show different columns on a table when different filters are selected

Hi, 

I have a filter with X Y Z and a table that reacts to the selection. Is there a way to create a table that will show only columns  A,B,C when filter X is selected and only columns P,Q,R when filter Y is selected?

Thanks is Advance. 
 

Labels (4)
1 Solution

Accepted Solutions
Andrei_Cusnir
Specialist
Specialist

Hello,

 

You can achieve this by adding an expression under Data > Columns > Show column if for each dimension of the table.

 

1. I have used the following load statements:

Filter:
load * inline [
Selection
    X
    Y
    Z
];

 

Data:
load * inline [
    A,B,C,P,Q,R
    10, 20, 30, 40, 50, 60
];

 

2. Now I have created a Filter pane and an Table chart:

IMAGE

 

3. For the columns A, B and C I have added the following expression: GetFieldSelections(Selection) = 'X' under Data > Columns > Show column if

4. For the columns P, Q and I have added the following expression: GetFieldSelections(Selection) = 'Y' under Data > Columns > Show column if

5. When selecting X:

IMAGE

6. When selecting Y:

IMAGE

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members. 
 

 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂

View solution in original post

2 Replies
Andrei_Cusnir
Specialist
Specialist

Hello,

 

You can achieve this by adding an expression under Data > Columns > Show column if for each dimension of the table.

 

1. I have used the following load statements:

Filter:
load * inline [
Selection
    X
    Y
    Z
];

 

Data:
load * inline [
    A,B,C,P,Q,R
    10, 20, 30, 40, 50, 60
];

 

2. Now I have created a Filter pane and an Table chart:

IMAGE

 

3. For the columns A, B and C I have added the following expression: GetFieldSelections(Selection) = 'X' under Data > Columns > Show column if

4. For the columns P, Q and I have added the following expression: GetFieldSelections(Selection) = 'Y' under Data > Columns > Show column if

5. When selecting X:

IMAGE

6. When selecting Y:

IMAGE

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members. 
 

 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂
GHasan
Contributor III
Contributor III
Author

Hi Andrei, 

Thanks for the detailed explanation. I have tried something similar and it worked:

GetSelectedCount(Selection)> =1 AND Concat(Selection, ' , ') Like  '*X*'


I appreciate your help on this.