Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to make columns in a table appear/disappear based on selection?

Hey all,

I have a table in Qlikview with several expressions in it. I want to make them appear when they are selected.

Under the presentation tab of my table properties I select the conditional option. If I write here: ListboxName= 'Columname'

then the column will appear on selection and disappear otherwise. The problem I have is when selecting multiple values this doesn't work anymore.

I think I should work with an if statement and maybe the getSelectedfields function but I have no idea how to do this.

Is there anyone who can help me with this?

Thanks in Advance,

Jens

13 Replies
Not applicable
Author

Hi Jens,

try this in the cond option:


Len (getfieldselections ( Fieldname)) = 0


Hints:

Fieldname is the table-fieldname. Don't use an if-clause in the condition term!

Regards, Roland

Not applicable
Author

Thanks for the response.

Your statement works but I still have the issue that he doesn't show all the values I select.

I have a listbox with all my columnnames and I want the column to become visible in the table when I select it in the listbox.

I can do this for each value but not when I select several options in the listbox.

In your statement I compare whether there is a value selected but I want to check for specific values.

Regards,

Jens

jonathandienst
Partner - Champion III
Partner - Champion III

Jens

Assuming that ListBoxName contains column names that you want to conditionally display, then perhaps something like:

=Wildmatch(GetFieldSelections(ListboxName), '*ColumnName1*')>0

If you want the selection to depend on mu;tiple selections, then add more compare strings like this:

=Wildmatch(GetFieldSelections(ListboxName), '*ColumnName1*', '*ColumnName2*')>0

Add as many column names as you need.

Note that if you could possibly select more than 6, then GetFieldSelections needs to be written like:

GetFieldSelections(ListBoxName, ',', 20)

just replace 20 with the maximum possible to likely number of column selections.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Oh, this is a little bit different than i thought before. But now I understand you better and I know what you want. What do you use for your listbox ? $Field?

Not applicable
Author

.... and I follow up Jonathan ......

Not applicable
Author

My listbox contains the names of my columns.

When I select one or multiple values in my Listbox I want the selected columns to become visible in my table.

jonathandienst
Partner - Champion III
Partner - Champion III

Jens

Then my earlier post should work for you

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks for the response Jonathan.

You solution also works but not when I select multiple values.

When I use:

Wildmatch(GetFieldSelections(ListboxName), 'Column1')>0 in the conditional field of my expression (in the presentation tab of the chart properties)

It shows Column1 in my table(graph) when I select it in my listbox

But when I select multiple values in my listbox I cannot see them in my table anymore.

I want that all the columns that I select appear in my table and this in a flexible way. So when I select only on than only that column should appear, but when I select multiple I want all of the selected to appear.

I am trying to reach this by using the conditional option in the presentation tab of my chart properties. Maybe this isn't the place to do this.

I think I need a condition for each column (expression) saying that if it is in the selected fields show it.

I hope that you have an idea of what I want to reach

Kind regards,

Jens

Not applicable
Author

Hi,

lets try to clear the situation:

I have two database-fields (Type and Amount) and a listbox containing $Field. Then I can use

  • Wildmatch(GetFieldSelections($Field), '*Type*')>0 in the condition option of the column refering to Type
  • Wildmatch(GetFieldSelections($Field), '*Amount*')>0 in the condition option of the column for Amount

This should help. Take care of the ( * ) !

To Jonathan:

I can't afford "GetFieldSelection(ListBoxName); My function needs a Fieldname as Parameter ?!?!