Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Capturing record counts into a variables

Is there any component or technique to capture record counts of rows going though the data pipeline at various points, into context variables?
for Example:
Count of rows coming out of tOracleInput
Count of rows coming into tOracleOutput => rows inserted, and rows updated
thanks,
Dave
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Santhosh,
Remove tJava, component, and link from flowmeter component to flowcatcher and then test again...
Vaibhav

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hello
There are some global vars which counts the number of rows out ot input component and insert into target components.
like
((Integer)globalMap.get("tOracleInput_1_NB_LINE"))
tip: press ctrl+blank space on tJava or any text field, you will a list of global vars.
eg:
tOracleInput--main-->tOracleOutput
|
onsubjobok
|
tJava
on tJava, type in:
context.query=((Integer)globalMap.get("tOracleInput_1_NB_LINE"));
context.update=((Integer)globalMap.get("tOracleOutput_1_NB_LINE_UPDATED"));
context.insert=((Integer)globalMap.get("tOracleOutput_1_NB_LINE_INSERTED"));
Best regards

shong
Anonymous
Not applicable
Author

Hello
There are some global vars which counts the number of rows out ot input component and insert into target components.
like
((Integer)globalMap.get("tOracleInput_1_NB_LINE"))
tip: press ctrl+blank space on tJava or any text field, you will a list of global vars.
eg:
tOracleInput--main-->tOracleOutput
|
onsubjobok
|
tJava
on tJava, type in:
context.query=((Integer)globalMap.get("tOracleInput_1_NB_LINE"));
context.update=((Integer)globalMap.get("tOracleOutput_1_NB_LINE_UPDATED"));
context.insert=((Integer)globalMap.get("tOracleOutput_1_NB_LINE_INSERTED"));
Best regards

shong

Is there a "OracleInput_1_NB_REJECT" global? I do not see that generated in the talend code.
I want to connect a runIf trigger from tOracleOutput_1 to a downstream tOracleRollback, based on ((Integer)globalMap.get("tOracleOutput_1_NB_LINE_REJECT")) > 0
thanks,
Dave
Anonymous
Not applicable
Author

David,
You can create a "REJECT" link relationship after your tOracleOutput and link that to a tFileOutputDelimited to grab the exception in a File.
This component have a globalVar returning the NB_LINE; it's exactly what you're looking for.
Best regards;
Anonymous
Not applicable
Author

Hi Shong,
I am new to Talend. I am trying to get the count of a table to insert into another. I am not getting any errors. But it inserts NULL value in "trgtcnt" column of my table,
mysql - Flowmerter - tmap1 - TMysqlOutput3
\ |
\ tJava
\ |
Flowcatcer - tmap2 - mysql
Here is my tJava query
context.query=((Integer)globalMap.get("tMysqlOutput_3_NB_LINE"));
Please advice me to move forward.
Thanks in Advance
Santhosh
Anonymous
Not applicable
Author

Hi Shong,
I am new to Talend. I am trying to get the count of a table to insert into another. I am not getting any errors. But it inserts NULL value in "trgtcnt" column of my table,
mysql - Flowmerter - tmap1 - TMysqlOutput3
\ |
\ tJava
\ |
Flowcatcer - tmap2 - mysql
Here is my tJava query
context.query=((Integer)globalMap.get("tMysqlOutput_3_NB_LINE"));
Please advice me to move forward.
Anonymous
Not applicable
Author

Hi Santhosh,
Remove tJava, component, and link from flowmeter component to flowcatcher and then test again...
Vaibhav