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.  Summing of Two Values

    Employee
    Posted 07-03-2013 06:38

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

    Originally posted by: vasuyala

    Hi,

    I have my data like below
    Col1 Col2 Col3 Col4
    A E 1 5
    B F 2 6
    C G 3 7
    D H 4 8


    I want the output like below
    Col1 Col2 Col3
    A E 6
    B F 8
    C G 10
    D H 11

    Please tell me the calculation how to acheive it

    Regards,
    Srinivasa


  • 2.  RE: Summing of Two Values

    Employee
    Posted 07-03-2013 07:54

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

    Originally posted by: simon.wilby

    Hi Srinivasa,

    You can achieve this by using the following Brainscript in a Filter node:
    emit Col1,Col2,(Col3+Col4) as "Col3"

    Note - the fields you're adding together cannot be of type string otherwise it will concatenate the two fields - i.e. your results would look something like this:

    Col1 Col2 Col3
    A E 15
    B F 26
    C G 37
    D H 48

    Regards
    Simon