6 Replies Latest reply on Jul 17, 2017 5:48 AM by Ritesh Bisht

    LOD first and last value listing and comparison

    Hector Saenz

      Hello,

      I have a dataset that includes the following fields: [Patient ID],  [Obs Date] and [Obs Value].  I need to create a dashboard that identifies the first and last dates per [Patient ID], list them along with associated [Obs Values] and finally compares the values to show if the results increased or decreased. Sheet 2 shows the raw data grouped by [Patient ID]. The desired result for patient "aaaaa" would show first and last  [Obs Dates] of 1/1/17 and 6/5/17 with associated results 22 and 15 (decreased).  Using the following LOD calculated fields I was able to calculate and list the first and last dates nicely on Sheet 4. Unfortunately I was not able to get the associated LastValue calculation to show the correct value.   It appears to be listing the last overall value. I attempted to use a LOD calculation but I kept getting formula errors.  Can you point me in the right direction. Thanks, Hector

       

      FirstDate              ATTR({include [Patient ID]: MIN([Obs Date])} )

      LastDate              ATTR({include [Patient ID]: max([Obs Date])} )

      LastValue            IIF(ATTR([Obs Date])=[LastDate],ATTR([Obs Val]),null,0)

       

      FLast1.png

       

      FLast2.png