Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
jerouy_qt
New Contributor

How to filter one column based on another when creating a select field?

Hi Folks,

Say, I have a table like this:

COL1
Visible
1yes
2yes
3no
4no
5yes

Normally I can create 2 fields: COL1 and Visible. COL1 shows all values (1,2,3,4,5) and Visible shows 'yes' and 'no'.

When I select 'yes' in 'Visible' manually, 1 2 5 will be white in COL1 and 3 4 will be greyed out.

But how can I create COL1 field with a condition so that it can by default show only 1 2 5 without having the user manually selecting 'yes'? (In this case I don't need to create the 'Visible' field at all)

Is it possible doing so without creating new tables?

I am aware there is a "conditional" checkbox in every field's Properties - Expressions tab. Is it the right place to look at? How to write the condition?

Thanks,

Jeremy

1 Solution

Accepted Solutions
rajni_batra
Valued Contributor

Re: How to filter one column based on another when creating a select field?

u wrote the expression in expression tab of  list box that's wrong use it in general tab of List Box (attached screenshot ) or create a Straight or pivot table & then wriite d same expression there inexpression tab.

Hope this Help

11 Replies
rajni_batra
Valued Contributor

Re: How to filter one column based on another when creating a select field?

DO u want to  Display COL1 only for those whose visible selection is :'yes'??

jerouy_qt
New Contributor

Re: How to filter one column based on another when creating a select field?

Yes exactly.

Sorry I didn't describe this clearly.

daveamz01
Contributor III

Re: How to filter one column based on another when creating a select field?

Hi,

It is possible with set analysis (see the file attached).

Regards,

David

rajni_batra
Valued Contributor

Re: How to filter one column based on another when creating a select field?

this is simple then use expression if(visible='yes',col1)

jerouy_qt
New Contributor

Re: How to filter one column based on another when creating a select field?

Adding to my original question, considering I have another table with the one above:

COL1COL2
1A
2B
3C
4D
5E

These 2 tables will be connect by column COL1.

I also want to create a select field that only shows A B E from COL2. That is, it filters the 2nd table's row based on a colume in the 1st table.

Is it possible?

Thanks.

Jeremy

jerouy_qt
New Contributor

Re: How to filter one column based on another when creating a select field?

Do you mean adding a expression in the "Expressions" Tab?

I tried, but the result looks very strange. It shows 2 columns. One is 1 2 3 4 5, the other is 1 2 - - 5.

Please check the screenshot:

col1.jpg

Any idea?

Thanks

jerouy_qt
New Contributor

Re: How to filter one column based on another when creating a select field?

Thanks for replying but my personal edition cannot open any QVW from other source anymore

Can you explain your solution by words?

Thanks

rajni_batra
Valued Contributor

Re: How to filter one column based on another when creating a select field?

see the scrrenshot

jerouy_qt
New Contributor

Re: How to filter one column based on another when creating a select field?

Thanks. It looks great!

Can you explain a bit more by words? I am not that familiar with QV now. By looking at the screenshot I can't figure out how did you do it.

Thanks.

Community Browser