Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Specialist
Specialist

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

View solution in original post

11 Replies
rajni_batra
Specialist
Specialist

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

Anonymous
Not applicable
Author

Yes exactly.

Sorry I didn't describe this clearly.

daveamz
Partner - Creator III
Partner - Creator III

Hi,

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

Regards,

David

rajni_batra
Specialist
Specialist

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

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

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
Specialist
Specialist

see the scrrenshot

Anonymous
Not applicable
Author

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.