Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
QVUser1
Partner - Contributor III
Partner - Contributor III

Show Column Names in a Table based on Conditions

Hi Team,

I have Table  as listed in the below:

I need to show columns based on multiple conditions:

  1. If no Filters are selected  it should  display all Columns
  2. If Student is selected , there is no values for Data Column. So it should display only three Columns(Student,Rolno,Marks)

 

Student Roll no  Marks Data
A 1   -
B 2   -
C 3 23 -
D 5 25 -
4 Replies
LRuCelver
Partner - Creator III
Partner - Creator III

Use =GetSelectedCount(Student)=0 for the show condition for the Data column.

henrikalmen
Specialist
Specialist

For the dimension "Data", you can enter an expression in the properties field "Show column if". Try one of these, both should probably work:

=getselectedcount(Student)=0

=count(Data)>0

QVUser1
Partner - Contributor III
Partner - Contributor III
Author

Thanks for the quick response.

The above expression works only if nothing is selected . but If I select any Student then column Data should not Appear.

It means Hide and show column on multiple conditions

henrikalmen
Specialist
Specialist

You are saying "if Student is selected, then hide the Data column". So the show-condition for column Data should be False when any number of values in the Student dimension is selected.

If you select one or more values in the dimension Student, the counter getSelectedCount(Student) will reveal how many unique students are selected - if no Student is selected the value is 0.

If no Student value is selected, the expression =getselectedcount(Student)=0 means "if 0=0", and the column will be visible since the statement is True. If two students are selected, the expression will be like "if 2=0" which is of course False, so the column should be hidden.

If this is not the case for you, I think maybe you are entering the expression in the wrong place or that there is something else in your data model affecting this that you haven't said anything about.

Another option is that we have not understaood your requirement, because in your last comment you say "It means Hide and show column on multiple conditions". What do you mean by that?