Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

honeyparpay
New Contributor II

AVERAGE BY MAXIMUM VALUE

Hi there!

I'm a bit lost , so i hope someone of you will give me light about the question below.

I got this example to explain the logic:

CENTRE IDPATIENT IDMESSURE ORDER TEMPERATURE
A10138,4
A11137,4
B21139,2
B22137,5
B22236,6
A10238,2
A11237,3
B21238,6
B21337,4
A10337
A11336,2
B21436,8
A10436,6

I need to know the (average of temperature by (maximum messure order by patient ID)).

I don´t wanna need to show the "Patient ID' field in the result which should be something like this:

CENTRETEMP. AVG
A36,4
B36,7

Regards,

Lan

1 Solution

Accepted Solutions
MVP
MVP

Re: AVERAGE BY MAXIMUM VALUE

Expression:

=Avg(Aggr(FirstSortedValue(TEMPERATURE,-[MESSURE ORDER]), [CENTRE ID],[PATIENT ID]))

PFA

7 Replies

Re: AVERAGE BY MAXIMUM VALUE

Can you elaborate your logic in more detail please?

honeyparpay
New Contributor II

Re: AVERAGE BY MAXIMUM VALUE

OK! I´m sorry about my english, when I said messure I meant to say measure.

Lets go...

There are 2 centres A and B.

Each centre got X inpatients (2 in the A and 2 in the B in this case).

I took the temperature several times for each patient (not the same times per each).

So i need to know the average of the temperature for the patients only for the last time i took the messure (being the last time, the maximum measure time of the temperature).

MVP
MVP

Re: AVERAGE BY MAXIMUM VALUE

Expression:

=Avg(Aggr(FirstSortedValue(TEMPERATURE,-[MESSURE ORDER]), [CENTRE ID],[PATIENT ID]))

PFA

Not applicable

Re: AVERAGE BY MAXIMUM VALUE

Hi,

Pls look into the attached qvw and let me know if this is what expected.

Thanks,

Prabhu

Re: AVERAGE BY MAXIMUM VALUE

Tresesco reached before me...

Dimension = [CENTRE ID]

Expression

Avg(Aggr(FirstSortedValue(TEMPERATURE,-[MESSURE ORDER]),[PATIENT ID],[CENTRE ID]))

honeyparpay
New Contributor II

Re: AVERAGE BY MAXIMUM VALUE

Actually the qvw works but i'm trying to check the logic in my enviroment, which much more complicated. 

honeyparpay
New Contributor II

Re: AVERAGE BY MAXIMUM VALUE

Hi tresesco,

Could you help me on this?

Some help with first and last on count({set analysis} DISTINCT aggr(firstsortedvalue)))

I got some troubles with this expression calculating the value on first or last [Orden Form]

=Count({<[Valor Item]={2},[Id Paciente]=P({<[Orden Form]={">=2"}>}[Id Paciente])>}DISTINCT Aggr(FirstSortedValue([Id Paciente],[Orden Form]),Bloque,Estudio,Centro))

Please, if you can help me let me know if you need any added information.

I will appreciate a lot any assistance.

Regards,

Lander

Community Browser