Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to count rows on lhs of tmap

I need to use count of rows from LHS(input) of tmap and use the count in output(RHS) of same tmap. How to acheive this ?

Labels (2)
5 Replies
Anonymous
Not applicable
Author

Hi,

 

    Since you are using an input or output component to capture the data, you can use NB_LINE variable of those components.

 

    A simple example is as shown below.

0683p000009M8ZR.png

 

You can use these values in the next subjob onwards (in the example, I am using in tJava after the first subjob).

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

akumar2301
Specialist II
Specialist II

Can you explain your use case please if Nikhil solution doesn’t work for you
Anonymous
Not applicable
Author

It seems Nikhil misunderstood the question .I have attached the snap now. 

Requirement is very simple . I need to have the count (no of rows of input i.e . row_header_2 in tmap LHS) and this count i need to use in RHS of the same tmap i.e for ex  currency column)


snap.PNG
akumar2301
Specialist II
Specialist II

Tmap does row by row operation.

If you need total no of recordcount of source in each row ,

You need to count it before you start tMap , put that count in globalVar
and then use it in output side.

If you need recordnumber of input at output , you can create a counter in
expression builder and use it in output.

Abhishek


Anonymous
Not applicable
Author

There is no sorting required.its a simple count of rows I need within tmap
itself to be used as output of a column from same tmap