6 Replies Latest reply on May 7, 2018 2:12 PM by Sara Bradberry

    Calculating DateDiff using LOD and parameters

    Sara Bradberry

      I am trying to calculate the age of this variable, (in my case, it is a document) using the multiple timestamps associated with the different status changes the occur during the document processing.  I need to basically EXCLUDE any instances where the "doc_status" is NOT "New".  I am currently using this calculation:

       

      IF [Weekdays]= "SHOW" AND [doc_status]= "New" THEN {FIXED [document_chronicle_id]:(DATEDIFF('day', MIN(timestamp),MAX(timestamp)))} END

       

      Which almost works, except you can see here because I'm using MIN and MAX, the calculation gives the total number of days in the datediff which is 9 when in reality, I need it to stop calculating when the status changes out of "New" which should come out to 3.

       

       

       

      I am out of ideas, and I apologize I cannot attach a workbook as the one Im working in has tons of PII and proprietary info.

       

      Any ideas are appreciated!