difference of values

sgenzer
sgenzer
Altair Employee
edited November 2024 in Community Q&A

OK I know there is an easy way to do this but cannot get my brain around it.  If I have an attribute that contains integers in ascending order but they are not sequential, how do I create a new attribute that shows the difference between each example and the one before it?  For example:

 

att1         delta

1             ?

3             2

4             1

5             1

17           12

20           3

 

etc..

 

Thanks.


Scott

Tagged:

Best Answer

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓

    Scott,

     

    the Lag operator is your friend.

     

    Generally speaking: All operations which requiere cross-example operations are rather in the time series extension than in core.

     

    ~Martin

Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Answer ✓

    Scott,

     

    the Lag operator is your friend.

     

    Generally speaking: All operations which requiere cross-example operations are rather in the time series extension than in core.

     

    ~Martin

  • sgenzer
    sgenzer
    Altair Employee

    Perfect.  Thank you Martin!


    Scott

     

  • Thomas_Ott
    Thomas_Ott New Altair Community Member

    Try the lag operator!