-1

I have used this expression in Cognos [Encounter Date]=maximum([Encounter Date] for [Patient Account Number]) to obtain the most recent visit. Does anyone know a command for two most recent visits?

somesingsomsing
  • 3,182
  • 4
  • 29
  • 46

1 Answers1

0

Create a data item that ranks [Encounter Date] for [Patient Account Number] Set the filter where [Rank] <= 2 Remember the filter should be AFTER aggregation (not the default before aggregation)

somesingsomsing
  • 3,182
  • 4
  • 29
  • 46
VAI Jason
  • 534
  • 4
  • 14