Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
qliklizzy
Creator II
Creator II

text object show the max date for current wait

hi

I have a cohort of people showing the time they came in and their associated EDwait

I have a text box that shows the number of these patient's waiting

=count({<MetricDesc=,MetricID={'LI01'},Status-={'DISCHARGED','COMPLETED','LETTER'}, Location-={'EAU'}, ReadyStatus -={''}>}  EventUniqueID)

the other box I need to show what the last persons wait was.. so I need a max of date but show the EDwait if you like ?

I tried this:

=Interval(max({<MetricDesc=,MetricID={'LI01'},Status-={'DISCHARGED','COMPLETED','LETTER'}, Location-={'EAU'}, ReadyStatus -={''}>} EDReadyWait)/24/60, 'hh:mm')

but this just gives me the max EDwait for all of those peopleI cant figure out how to add in the max date

thanks

1 Solution

Accepted Solutions
jonathandienst

Give this one a shot:

FirstSortedValue({<

  EventUniqueID = P({<

  MetricDesc=,

  MetricID={'LI01'},

  Status-={'DISCHARGED','COMPLETED','LETTER'},

  Location-={'EAU'},

  ReadyStatus -={''}>

  }  EventUniqueID)

>} EDReadyWait, -assessmentdatetime)


Wrap this expression in an interval function if required

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

15 Replies
Anil_Babu_Samineni

What this returns when you use below one?

max({<MetricDesc=,MetricID={'LI01'},Status-={'DISCHARGED','COMPLETED','LETTER'}, Location-={'EAU'}, ReadyStatus -={''}>} EDReadyWait)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
qliklizzy
Creator II
Creator II
Author

Hi

this just shows the max value of EDready wait.

So if there was 10 people who are ED ready it shows the longest wait,

however I need to refine it to the last person who came in , so max date and bring back their EDready wait

thanks

tresesco
MVP
MVP

Try using FirstSortedValue(), like:

=FisrtSortedValue({Set analysis} PatientField , -EDreadyWait)

jonathandienst

How do you identify the last person who came in (ie which field and what does the field contain)?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
qliklizzy
Creator II
Creator II
Author

assessmentdatetime  is the time they came in,

I need a max of this, on the set analysis, bringing back the edready wait

thanks

qliklizzy
Creator II
Creator II
Author

thanks

this doesn't work.. I get a big number..

do you mean paitentfield is the date I need the max applying to?

=FirstSortedValue({<MetricID={'LI01'},Status-={'DISCHARGED','COMPLETED','LETTER'}, Location-={'EAU'}, ReadyStatus -={''} >} AssessmentDateTime , -EDReadyWait)

tresesco
MVP
MVP

May be this?

=FisrtSortedValue({<MetricID={'LI01'},Status-={'DISCHARGED','COMPLETED','LETTER'}, Location-={'EAU'}, ReadyStatus -={''} >} PersonField , -assessmentdatetime)

qliklizzy
Creator II
Creator II
Author

sorry was is person field?

thanks

qliklizzy
Creator II
Creator II
Author

sorry I edited my first reply to you, as I had first spelt incorrectly.

it returns a big value, where I need it to display time.

so I applied interval to it but it still doesn't retrieve the right answer.

the last person in should be 00:18 but I get 718:49

=interval(FirstSortedValue({<MetricID={'LI01'},Status-={'DISCHARGED','COMPLETED','LETTER'}, Location-={'EAU'}, ReadyStatus -={''} >} AssessmentDateTime , -EDReadyWait)/24/60, 'hh:mm')