Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
baylor2016
Creator
Creator

How to get summary from firstsortedvalue?

Hi,

I was able to get the last BMI status (underweight, healthy weight, overweight and obesity) by using FirstsortedValue for each patients by using PAT_NAME AND PAT_ID as dimension,

=FirstSortedValue( distinct
{$<YearMonth,
BMI={'>0'},
VISITTYPE={'Office visit'},

CONTACT_DATE ={"$(='<=' & Date(enddateSelected))"}>} INTBMI, -CONTACT_DATE)

I would like to know how to get the summary for all the patients - the patient number for each BMI category. I thought it might need use AGGR function. But I have not clue how to get it done.

 

Please help.

 

Thanks

Labels (2)
1 Solution

Accepted Solutions
rubenmarin

Hi, maybe adding it as dimension:
=Aggr(FirstSortedValue( distinct
{$<YearMonth,
BMI={'>0'},
VISITTYPE={'Office visit'},
CONTACT_DATE ={"$(='<=' & Date(enddateSelected))"}>} INTBMI, -CONTACT_DATE), PAT_ID)

And Count(Distinct PAT_ID) as expression

View solution in original post

2 Replies
rubenmarin

Hi, maybe adding it as dimension:
=Aggr(FirstSortedValue( distinct
{$<YearMonth,
BMI={'>0'},
VISITTYPE={'Office visit'},
CONTACT_DATE ={"$(='<=' & Date(enddateSelected))"}>} INTBMI, -CONTACT_DATE), PAT_ID)

And Count(Distinct PAT_ID) as expression
baylor2016
Creator
Creator
Author

Great! Works perfectly!