Is there an operator to calculate the difference with its previous value?

chee_altair_com
chee_altair_com
Altair Employee
edited November 2024 in Community Q&A
Is there an operator to calculate the difference with its previous value?

If the attribute has these values: [ 3, 7, 9, 6, 11 ]
Can we generate an attribute consisting of the differences of the two values? 
Like:   [ 4, 2 -3, 5]?
Tagged:

Best Answer

  • Caperez
    Caperez Altair Community Member
    Answer ✓
    Hi @c_chee
    a quick way is using the Lag operator for Time series. with this operator you can create a new attribute with a Lag and then you can calculate the diffenrence between the attributes. 
    Other option is using the loop operators. 

    Best. 

    Cesar

Answers

  • Caperez
    Caperez Altair Community Member
    Answer ✓
    Hi @c_chee
    a quick way is using the Lag operator for Time series. with this operator you can create a new attribute with a Lag and then you can calculate the diffenrence between the attributes. 
    Other option is using the loop operators. 

    Best. 

    Cesar
  • chee_altair_com
    chee_altair_com
    Altair Employee
    Hi Ceaperez,

    Thanks for the answer. I'll have a look soon, but I'm sure it'll work.

    Clinton