Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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.
Highlighted
Specialist
Specialist

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

Can anyone else offer any insight?

Thank you!
Highlighted
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.
Highlighted
Specialist
Specialist

Vishsaggi,

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

 

Highlighted
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