LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Subtract row two from row one

    Employee
    Posted 09-18-2014 03:21

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ThomasT

    Does anyone know how can I subtract the value in a field in row two from a value in row one and then loop downwards?

    Like this:
    Number Result
    124243600 0
    124243400 200
    124243300 100
    124243200 100
    124243100 100
    124242900 200
    124242800 100


  • 2.  RE: Subtract row two from row one

    Employee
    Posted 09-18-2014 06:04

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    You'll need to store the number previous number in a dummy variable (in example below, prevNum). Copy and paste the text between the lines of *'s into a graph (BRG).

    *************************

    node:Filter
    bretype:core::Filter
    editor:sortkey=541ad648752e70d2
    input:@40fd2c74167f1ca2/=Static_Data.40fe6c55598828e5
    output:@40fd2c7420761db6/=
    prop:Script=<<EOX
    if firstExec
    then {
    prevNum = Number
    Diff = 0}
    else {
    Diff = prevNum - Number
    prevNum = Number}


    emit *, Diff

    EOX
    editor:XY=170,110
    end:Filter

    node:Static_Data
    bretype:core::Static Data
    editor:sortkey=541ad5f1337a3b5e
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    Number:int
    124243600
    124243400
    124243300
    124243200
    124243100
    124242900
    124242800
    EOX
    editor:XY=70,110
    end:Static_Data

    *************************


  • 3.  RE: Subtract row two from row one

    Employee
    Posted 09-18-2014 23:57

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ThomasT

    Great!
    Thank you!