Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

Hide/Show column based on a Field value

How do I show/hide a column in Straight or Pivot table based on values from other fields?

For example, if FieldA contains 'Yes', then show the column. If the FieldA does not contain 'Yes', then hide the column. Just to make it clear, I don't want to make selections on FieldA. The condition should check if there is a required value in the field and show/hide the column on its own, without user selection on the field.

Labels (2)
6 Replies
Miguel_Angel_Baeyens

You can use functions like GetSelectedCount() or Count(DISTINCT Field) and also GetPossibleCount(), I'd say Count(DISTINCT) along with CONCAT(DISTINCT) is the best bet.

If you mean the value not on a listbox or on a field but instead on the chart itself, replicate the expression in the chart as the condition box.

qlikwiz123
Creator III
Creator III
Author

Hi @Miguel_Angel_Baeyens 

The problem here is, I don't want to select the value from the field in the list box or anywhere else and all these functions would only work if I select the value explicitly.

If the FieldA contains value 'Yes', then show the expression, else hide the expression.

I don't want to select 'Yes' in FieldA manually to trigger the Hide/Show condition.

Miguel_Angel_Baeyens

Only one of those 4 functions use what it is actually selected.

To follow with the example with Concat() that you should be testing already

Concat(Field, ';')

Will return a list like A;B;C;D;E;F;G as long as those are possible values (meaning, on the green or white values, not grey. If you need grey values as well, use the {1} set modifier).

Then building a condition to check whether a value is present, you can easily use the following as the condition expression

If(WildMatch(Concat(Field, ';'), '*FieldA*') > 0, 1, 0) 

As you can see, this does not require any selection by any user.

shiveshsingh
Master
Master

Hi

@qlikwiz123 

Go to layout tab and put this condition

Wildmatch(concat(FieldA,','),'*Yes*')

qlikwiz123
Creator III
Creator III
Author

Layout hides the entire chart. I only need to Hide/Show if the value 'Yes' is present or absent in FieldA, without user selection on FieldA

shiveshsingh
Master
Master

Yes, this will hide the chart based on the Value Yes.
If yes is not present in FieldA, then chart will be hidden.