- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Measure is not evaluating
I have a measure that creates a flag (1 or 0) when the discharge_phq score is 50% or less than the admit_phq score.
I then have a second measure to sum the flag field 'phq_50'.
I use this expression - if([phq_50]='1',count(distinct [Patient IMREDEM]),99)
Note - [Patient IMREDEM] is a unique field in each row.
In the example above, I would expect the result to be 3, but the result is always the else '99'. The expression doesn't seem to be evaluating the flag field.
Seems simple enough, but I have tried several things to no avail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where do you need to use your 2nd measure? I guess you want to use that in KPI but not sure? I suggest you should improvise the 1st measure to get what you want in 2nd measure.
e.g. Sum(Aggr(first measure),dimensionfield)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, yes, the 2nd measure is for KPI.
I tried this as well - If((admit_phq-discharge_phq) >= (admit_phq/2), count([Patient IMREDEM]),99)
That didn't work either. I do not understand your example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Whats the logic of 99 else value. if you just want to count 1's when condition is true, you can use
Sum(If((admit_phq-discharge_phq) >= (admit_phq/2), 1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OR
Count(If((admit_phq-discharge_phq) >= (admit_phq/2), [Patient IMREDEM])
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks so much for the suggestions. I tried both, separately, of course. They both are error free, but they produce the same result.
Sum(If((admit_phq-discharge_phq) >= (admit_phq/2), 1))
Count(If((admit_phq-discharge_phq) >= (admit_phq/2), [Patient IMREDEM]))
It just doesn't seem to be evaluating the expression correctly. I am at a total loss.