Announcements
cancel
Showing results for
Did you mean:
Contributor III

## Histogram with value intervals as dimension.

Hello,

I have the following fact table:

VisitDate, Patient, KFRE

KFRE is a numerical value between 0 and1.

I was able to create a nice simple histogram where chart dimension is =Round(KFRE, 0.025)  and expression is =Count(Patient) .

This gives me the number of visits with KFRE values within each KFRE interval for all the visits.

Since a patient can have more than 1 visit I need such histogram but only for the last patient's visit.

The expression would be something like this:

=Count({<VisitDate={\$(=Max(VisitDate))}>}Patient)

but I am not getting any values on output.

What am I doing wrong?

1 Solution

Accepted Solutions
Contributor III
Author

I have found a solution in this thread:Help with Set Analysis - MAX

The needed expression does not use set analysis:

=count(If(VisitDate=Aggr(Nodistinct Max(VisitDate),Patient),Patient))

11 Replies
Master II

Hi,

Try like below,

=Count({<VisitDate={'\$(=Max(VisitDate))'} >} Patient)

if it's not working, can you share your sample app with mock data. tks

also check this

Histogram example

Recipe for a Histogram

Regards,

Deva

Contributor III
Author

Thank you for your reply, but same result - no values on the output.

MVP

May be this:

FirstSortedValue(Aggr(Count(Patient), VisitDate, Patient), -Aggr(VisitDate, VisitDate, Patient))

Contributor III
Author

Thanks Sunny, but this does not seem to work...

In the attached sample I am looking to get this:

 ROUND(KFRE,0.025) Last Visit KFRE Count 0.050 2 0.600 1
MVP

Try this

Dimension

=Num(Aggr(FirstSortedValue(Round(KFRE,0.025), -VisitDate), Patient), '#.000')

Expression

=Count(DISTINCT Patient)

Contributor III
Author

Thank you Sunny.

This works, but it appears that Patient is now the dimension in the chart, not KFRE

When I make a selection in the chart I am selecting patients.

Is there a way to change this, so making a selection in the chart selects KFRE values?

MVP

This, unfortunately won't be possible I think.... But I may be wrong and someone else might be able to assist....

Contributor III
Author

Thank you so much for your help Sunny!

I'll keep on pounding at this for some time...

MVP

Sure....One way I can think is to add triggers, but it can become a little messy...

Community Browser