5 Replies Latest reply: May 11, 2018 10:41 AM by Ali Hijazi RSS

    Previous 1, Previous 2, and Previous 3

    Ali Hijazi

      Hello got the following data:

      EmpCode, Value

      101, 5

      101,8

      101,76

      102, 6

      103, 66

      103,90

      103,150

      103,75

      ....

       

      What I want to accomplish is the following:

      EmpCode, Value, Previous_1_Value, Previous_2_Value, Previous_3_Value

      101, 5, NULL,NULL,NULL

      101,8,5,NULL,NULL

      101,76,8,5,NULL

      102,6,NULL,NULL,NULL

      103, 66,NULL,NULL,NULL

      103,90,66,NULL,NULL

      103,150,90,66,NULL

      103,75,150,90,66

      ....

       

      i know the previous 1 I can use previous function if I order data by empCode

      but how to accomplish previous_2, and Prvious_3

       

      Kindly Advise