Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
kev6brown
Partner
Partner

List Box

Hi,

 

I have a list box, Drugs, but I only wanted to see the values that are being populated against patient_no. So rather than see every drug that has no associated patient i only want to see the drugs that have associated patients, how do i do that?

 

Kev

1 Solution

Accepted Solutions
marcus_sommer
MVP & Luminary
MVP & Luminary

Try it with:

subfield(aggr(only({< Patient = {"*"}>} Drug), Drug), ,'!',1)

- Marcus

View solution in original post

6 Replies
QFabian
Specialist II
Specialist II

Hi @kev6brown , if you want to do that in script, you can do something like this, the key is find a field present in both tables, in this case a use ID_Drug, but it can be patient_no if it is present in both tables.

EXISTS is a great function to filter as you want

Patient:

Load

patient_no,

Id_Drug,

more fields...

From yoursource;

 

Drug:

Load

Id_Drug,

Drug

From yoursource

Where

exists (Id_Drug, Id_Drug);

 

Please let my know if this is an acceptble solution for you

QFabian
kev6brown
Partner
Partner
Author

I can't access the script to do this, can it be done from the front end?
QFabian
Specialist II
Specialist II

In that case, please check this :

QFabian_0-1613660608562.png

 

QFabian
marcus_sommer
MVP & Luminary
MVP & Luminary

You could try it with an expression as listbox-source - something like this:

aggr(only({< Patient = {"*"}>} Drug), Drug)

- Marcus

kev6brown
Partner
Partner
Author

That's perfect, thank you so much. Just to throw a curveball in, I have the following too -

=subfield([Drug],'!',1)

How do I make the expression include this?

marcus_sommer
MVP & Luminary
MVP & Luminary

Try it with:

subfield(aggr(only({< Patient = {"*"}>} Drug), Drug), ,'!',1)

- Marcus

View solution in original post