Jacek Bartlewicz Posted October 29, 2020 Share Posted October 29, 2020 Hi, I am relatively new to Spotifire and would appreciate support from some more advanced users ;) I would like write an expression to count the number ofunique subjects in a study with a specific value. For example, from a table below: Patient Cohort Measurement 101 A 10 101 A 12 201 A 10 201 A 11 201 A 13 301 B 10 401 B 11 501 B 10 501 B 11 I would like to Count the number of Patients with Cohort A (so, in the above example, the result would be 2). I tried using the expression UniqueCount([Patient] when [Cohort] in ("1")) but the syntax does not seem to be correct. May I kindly ask what the correct expression would be here Link to comment Share on other sites More sharing options...
Matthias Garbs Posted October 30, 2020 Share Posted October 30, 2020 Try UniqueCount(case when [Cohort] in ("1") then [Patient] else Null End) In this way you get first all the patients that fulfill the requirement and then you have a uinque count on those patients. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now