5 Replies Latest reply on Aug 5, 2016 2:22 PM by Cerberus DA

    How to find a Date when Running total crosses a mark.

    Cerberus DA

      Hi,

       

      I have a dataset in the following format:

       

          

      App_IDDateEarnings
      1301/1/1510
      1301/2/1515
      1301/3/155
      1451/1/1545
      1451/2/1530
      1451/3/1560

       

       

      This is a prototype. I want to find out the date when the Running total of the earnings crosses particular marks, say 100/200/300 and so on. I tried using CASE:

       

      CASE RUNNING_SUM([earnings])

      when > 1000

          THEN MIN([date])

      WHEN > 2000

           THEN MIN([date])

      END

       

      This doesn't work. I get an error: Maybe you are missing an identifier.

       

       

       

      I need something like:
      APP_iD  | Date_100  | Date_1000  | Date_10000
      113       2015-01-01  2015-01-04   2015-01-09

       

       

       

      My knowledge of the tool is very limited and this is all I could think of. Is there any way to getting that date? Any help is appreciated.

       

      Thanks!