Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Assigning current selection to a filed

Hi,

i am capturing the current selection in a variable

like below to get the current Selected SURGEON name.

vSurgeon=GetFieldSelections(SURGEON)

I am using this variable in  another expression to get the count of cases in which the selected SURGEON was an ASSISTANT_SURGEON

='Case Count (Assist Surg): ' & (num(count({<ASSI_SURGEON ={'$(=vSurgeon)'}>}distinct CASEID)))

but this is giving me the result as 0.

Note: A SURGEON cant be a an ASSISTANT SURGEON at same time. Could this error since when I select the SURGEON Name it will  grayed out form the List of ASSISTANT SURGEON?

Any way on hard coring the the surgeon name in the expression I am getting the correct result.

=count({$<ASSI_SURGEON = {'ROBERT S'}>}distinct CASEID).


Does someone have any idea on this?


Thanks

Saritha Xavier

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I see two issues here:

Your variable does not enclose all values in single quotes, per value. So if you select more than one SURGEON, you element list will not be formatted correctly.

If selections in SURGEON and ASSI_SURGEON are incompatible, you need to clear selection in SURGEON when assigining a set to ASSI_SURGEON.

I would try it like

=count({$<ASSI_SURGEON = SURGEON, SURGEON =>}distinct CASEID).

View solution in original post

2 Replies
swuehl
MVP
MVP

I see two issues here:

Your variable does not enclose all values in single quotes, per value. So if you select more than one SURGEON, you element list will not be formatted correctly.

If selections in SURGEON and ASSI_SURGEON are incompatible, you need to clear selection in SURGEON when assigining a set to ASSI_SURGEON.

I would try it like

=count({$<ASSI_SURGEON = SURGEON, SURGEON =>}distinct CASEID).

Not applicable
Author

Thanks Swuehl, this solved my issue.