Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to count the number of patients who meet two conditions:
I set up an "as-of" table linked to my fact table:
[CC] contains values like 'Hypertension.' [AgeAtEvent] contains age values. The fact table looks like this:
I am struggling with the set analysis to count these patients. This includes patients even when the CC condition is not met:
=Count({<PatientID=p({<IsSameYear={1}, AgeAtEvent={">=18<=85"}>})>*<PatientID=p({<[CC]={'Hypertension'}, YearDiff={"<2"}>})>} Distinct PatientID)
Thanks for any help!
Are you missing the field in your P() ?
=Count({<PatientID=p({<IsSameYear={1}, AgeAtEvent={">=18<=85"}>} PatientID)>*<PatientID=p({<[CC]={'Hypertension'}, YearDiff={"<2"}>} PatientID)>} Distinct PatientID)
But i don't think your calculation logically matches what you wrote. Your first set doesn't include anything about CC, so first set will return PatientIDs between 18-85 and SameYear=1 (whatever this is). The 2nd set will return all patient IDs who have CC = Hypertension, but doesn't include anythign about age. So you will get patients who were 18-85 at some point in your data/filters and had hypertension at some age, but not necessarily the combination.
Why 2 sets for PatientID? And not:
=Count({<PatientID=p({<IsSameYear={1}, AgeAtEvent={">=18<=85"}, [CC]={'Hypertension'}, YearDiff={"<2"}>} PatientID) >} Distinct PatientID)
Thanks for the reply, Steve. I thought that the intersection of my two sets, using the * between them, would get me patients who meet both conditions.
I can't put everything into one set because the fields [IsSameYear] and [YearDiff] would collide. They are in the As-Of Calendar.