7 Replies Latest reply on Dec 19, 2013 7:50 AM by Banusaranya Duraisamy

    How to find the date difference with one date field when a measure field exceeds certain value?

    Banusaranya Duraisamy

      I have one date field and I want to find the number of days it takes to exceed the amount 50,000 within the partition. Please find the Explanation below. I need to generate the column 'Date Diff' in tableau.

       

       

      IDCurrencyTrade DateAmount Date Diff  Explanation
      123EUR3/24/201380,5001first occurrence that exceeds 50,000
        within the partition so 1
      123EUR5/8/201350,0000<= 50,000 so 0
      123EUR5/25/201360,25045diff
        between last occurrence of the date when the amount exceeded 50,000. i.e
        datediff(5/25/2013,3/24/2013)
      123EUR6/24/201320,0000
      123USD4/3/2013120,2001first occurrence that exceeds 50,000
        within the partition so 1
      123USD5/13/201320,0000
      123USD6/12/201360,15051diff
        between last occurrence of the date when the amount exceeded 50,000. i.e
        datediff(6/12/2013,4/3/2013)