Customer Portal

Communication between records

Comments 1

  • Avatar
    admin
    0
    Comment actions Permalink
    Hi Bob,

    There is few options how you can remember data of previous records while passing through transformation components, e.g. Reformat:

    1) store previous values in dictionary - http://doc.cloveretl.com/documentation/ ... -ctl2.html

    2) define "global" variable which can hold data during whole transformation run


    //#CTL2

    integer lastValue;

    function integer transform() {
    //current value not null
    if ($in.0.value!=null) {
    //send to output
    $out.0.value = $in.0.value;

    //update last non-null value
    lastValue = $in.0.value;
    } else {
    //use last non-null value for output
    $out.0.value = lastValue;
    }

    return ALL;
    }


    For both approaches you may use map/list datatype, see http://doc.cloveretl.com/documentation/ ... -ctl2.html for details.

Please sign in to leave a comment.