Customer Portal

How to filter every other row

Comments 2

  • Avatar
    admin
    0
    Comment actions Permalink
    Hi welshed2,

    for filtering every other row you may use Reformat with code like this:


    //#CTL2

    boolean ignoreThis = true;

    function integer transform() {

    //toggle state
    ignoreThis = !ignoreThis;

    if (ignoreThis) {
    //filter out
    return SKIP;
    } else {
    //copy input record to output
    $out.0.* = $in.0.*;

    //send output
    return ALL;
    }
    }


    For counting rows according to some field value: first filter out "good" rows using http://doc.cloveretl.com/documentation/ ... ilter.html and then count them using http://doc.cloveretl.com/documentation/ ... egate.html

    I hope this helps.
  • Avatar
    welshed2
    0
    Comment actions Permalink
    Perfect! Thanks so much for your prompt reply.

Please sign in to leave a comment.