Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
qlikwiz123
Contributor

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

Re: Hide/Show column based on a Field value

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
Contributor

Re: Hide/Show column based on a Field value

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.

Re: Hide/Show column based on a Field value

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
Honored Contributor

Re: Hide/Show column based on a Field value

Hi

@qlikwiz123 

Go to layout tab and put this condition

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

qlikwiz123
Contributor

Re: Hide/Show column based on a Field value

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
Honored Contributor

Re: Hide/Show column based on a Field value

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