Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mphekin12
Specialist
Specialist

Top Two Dates

All,

I'm trying to figure out a way to show only the last two procedure stop times by primary surgeon and for an admit date in a chart (straight table or pivot) and I'm having trouble coming up with a solution.  Here is what my data looks like currently:

Capture.PNG

I only want to display those rows that have the highlighted timeProcedureStop column in my final chart.  The above data only shows two surgeons and one admit date, but there will be multiple surgeons and admit dates on the final chart.

Any suggestions?

Thanks for your help!

Labels (2)
5 Replies
vishsaggi
Champion III
Champion III

If you using straight table you have Dimension limits tab in chart properties where you can give largest 2 for your timeprocstop field. IF you are using pivot you might want to write and calculated dimension like

= Aggr(IF(Rank(Max(timeProcedureStip)) <=2, primarySurgeon), PrimarySurgeon)

something like this.
mphekin12
Specialist
Specialist
Author

Vishsaggi, thanks for the reply but unfortunately neither of the solutions you suggested worked.

Can anyone else offer any insight?

Thank you!
vishsaggi
Champion III
Champion III

The screen shot you attached is this a sample data ? If yes can you share this data as a text file or in a table where i can work on it.
mphekin12
Specialist
Specialist
Author

Vishsaggi,

I have attached some sample data for your review.  Thank you for looking at this!

 

vishsaggi
Champion III
Champion III

Try this in your straight table calculated expression for dimension primary surgeon like below and check supress when value is null for this calculated dim expr.

= Aggr(IF(Rank(Max(timeProcedureStop))<=2, primarySurgeon), primarySurgeon, timeProcedureStop)

 Capture.PNG