5 Replies Latest reply: Nov 9, 2017 2:21 AM by Michele De Nardi RSS

    Compare current and previous record

    sudhakar yadav

      hello everyone,

       

      please help me out for calculating the CalCustomer field given in the attach file.

       

      i have written this  code but its not working in my way

      output is also attach.

       

       

      Base:

      LOAD

          Region,

          "Year",

          Customers

          

      FROM [lib://abc.xlsx]

      (ooxml, embedded labels, table is Sheet1);

       

      Left join(Base)

      Load

      Region,

      "Year",

      if([Region]=Previous([Region]),(Customers+previous(Customers)),Customers)as CalCustomers

      Resident Base

      order by Region,"Year";

        

      Exit Script;