Register Login

How to do Total Number of Records Count in Various Nodes Should Pass to Target Field?

Updated May 18, 2018

Hello Experts,

Need help on this,

We have a file, Under file we have various Nodes. Each Node contains Various Records. The Requirement is the Total Number of Records count in Various Nodes should pass to Target field.

I tried with the logic by using Count and Add but Now I am expecting is there any UDF for this.

Kindly let me know the UDF if any one have an Idea.

Thanks in advance.


Comments

  • 02 Nov 2015 3:17 pm Rohit Mahajan Helpful Answer

    Simple declare a global variable in functions tab and at each node when ever you are using count fn please pass that count to a udf where it I'll add (global total=current rec cnt + global total)). Like that by end and of last node you ill be adding all rec count. Now map of that overall global count total by using another udf get global total and map it.

  • 02 Nov 2015 3:19 pm Chandan Singh Parihar Helpful Answer

    Two options:

    1) Via graphical(its very simple and we should go with this only):

    Make Records in a single queue(change the context to immediate parent node),use function "count" and pass to target element.

    2) Via UDF:

    Make Records in a single queue(change the context to immediate parent node) and write the logic of count via UDF.
    int count=0;
    for( int i=0; i<var1.length;i++)
    count=count+1;
    result.addValue(count);


×