Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
daniel1990xyz
Contributor III
Contributor III

Set analysis / aggr - Get value over 2 dimension

Hello everyone,

I need some help regarding the following problem:

I have a chart with the Dimension "PatientID" and I want to show as an expression for each Patient the oldest "Hb" value (marked values in the screenshot). As shown in the screenshot a patient can have different parameter values for a date. The relevant parameter (in this example "Hb") is stored in the variable "Para4PatOverview".

exampleData.JPG

I have tried to implement this requirement with aggr and set analysis but I can't solve completely the problem.

The following code works, but only when one entry for the oldest date for a patient is stored in the dataset (green marked example).

=min(aggr(if(DiagramDate =Min({<DiagramPar={$(Para4PatOverview)}>} DiagramDate), DiagramValue),DiagramDate))

When more than one entry is available for the oldest date for the patient (red marked examples) the code returns nothing.

I am grateful for any help.

Best regards,

Daniel

1 Solution

Accepted Solutions
sunny_talwar

Can you give this a shot may be:

=FirstSortedValue(DISTINCT {<DiagramPar = {'Hb'}>} DiagramValue, -DiagramDate)

View solution in original post

4 Replies
sasiparupudi1
Master III
Master III

may be try

=min(aggr(if(DiagramDate=Min({<DiagramPar={$(Para4PatOverview)}>} DiagramDate), DiagramValue),DiagramDate,PatientID))

sunny_talwar

Can you give this a shot may be:

=FirstSortedValue(DISTINCT {<DiagramPar = {'Hb'}>} DiagramValue, -DiagramDate)

lironbaram
Partner - Master III
Partner - Master III

hi

you can use this expression

=if(DiagramDate =min(total <PatientID> {<DiagramPar={hb}>}aggr(min({<DiagramPar={hb}>}DiagramDate ),PatientID)),red())

daniel1990xyz
Contributor III
Contributor III
Author

Thank you, this solves my problem.