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.  Input depending calculation

    Employee
    Posted 04-23-2013 06:00

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

    Originally posted by: ThomasT

    I have this node that sums some columns.
    My problem is that the input columnss isnt always the same.

    So what do i do when "Service" isnt available in the input data in the example below?

    X = Fixed+Freephone+International+Mobile+Service+'Spec ial 70-no'+'Special 90-no'
    emit *, X as "Total"


  • 2.  RE: Input depending calculation

    Employee
    Posted 04-23-2013 06:28

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

    Originally posted by: ThomasT

    Ahhh.. Solved it by adding the columns in as a static node with no value and then removing the line with no data.


  • 3.  RE: Input depending calculation

    Employee
    Posted 04-29-2013 08:04

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

    Originally posted by: Wizardous

    Hi ThomasT

    I think the script below is going to work for you regardless of making manuel changes.
    First you need to emit the fields those you want to get totals to end of table (right of table)

    like this:
    emit id
    emit name
    emit columnfortotal1
    emit columnfortotal2
    emit columnfortotal3

    then use the script below in a filter node.

    Liste=inputFields("in1") ###Here "in1" would be pin name of your input
    l=len(Liste)
    i=0 ### here you should give the number of columns as "i" that you dont want to get totals. otherwise you will get a string total of whole columns.
    vtotal=null
    while i<=l-1
    {
    total=field(getItem(Liste,i))+vtotal
    vtotal=total
    i=i+1
    }

    emit *,total

    Hope it helps.

    Regards,

    �zg�n