Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Experts,
I am using following syntax to get the number of patients who had a lab test (ID 1526664),
count(distinct {$<PAT_ID={'=COMPONENT_ID=1526664'}>}PAT_ID)
It returns only 1 even though there are 8 unique PAT_IDs. However, when 1526664 in the listbox is selected, this syntax returned correct number (8) of distinct PAT_ID. I cannot understand this. Please advice.
Sample project is attached for your reference.
Thanks in advance.
Longmatch.
This might be what you are looking for:
Dear Petter,
Thank you for your helps. I am trying to use Nicole Smith's method for this kind of work. Please refer her reply to my previous post - Nested aggregation helps. I just want to see know why it does not work here.
Thanks
Longmatch
OK - so do you still want anyone to answer your question or did my suggestion answer it? If not please let us know.
What is your Intend. And Above Provides expression seems work. What was you are expecting into?
Thank you - Petter and Anil,
Petter provided works but actually my question is what is the problem in my expression and the strange behavior in my sample project. I am planning to use this logic in my project for intersection set analysis.
May be you want to do this:
='1526664 Patient number: ' & count(distinct {$<PAT_ID={"=WildMatch(Concat(DISTINCT COMPONENT_ID, ', '), '*1526664*')"}>}PAT_ID)
PAT_ID is made up of several COMPONENT_ID, so in order to check if one of them is 1526664, you need to either use WildMatch, Index or SubStringCount function with Concat() on COMPONENT_ID to make this work
petter-s gave the correct answer of:
count( {$<COMPONENT_ID={1526664}>} distinct PAT_ID)
You should go with this because it is the simplest approach.
Your last post needed aggregations within the set analysis, which is why it was more complicated.
Sunny, Thank you for your helps. Your solution works well. I wish I can also make yours as correct answer.
Hahahaha no problem my friend. My solution was just to explain why your attempt did not work, but I would go with what petter-s gave because that is the way to do this .
Best,
Sunny