Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Getting a row count before counting the rows.

Hi,
I'm trying to get an initial row count into a global variable based on a column, so for example:
I have 6 rows, the first 5 belong to one account holder (there is a ledger_id which is duplicated - it's a foreign key), the last one belongs to another account holder. In one column there is a requirement to put in direct debit descriptions which follows the format 'Payment No. of ' so, for example, the second row for the first account holder contains in the direct debit descriptions 'Payment No. 2 of 5'.
My question is, how do I get the '5'? I have tried to do it Talend. I can do this in SQL, but I need automation.
warm regards,
Lee
Labels (2)
19 Replies
Anonymous
Not applicable
Author

hi ,
i am create a file to delete last three row in talend. I can use following statement for count the number of rows in table:
((Integer)globalMap.get("tMysqlInput_1_NB_LINE"))
but i get null value in table.
Anonymous
Not applicable
Author

hi
how to get no of rows in the tmssqloutput?
Anonymous
Not applicable
Author

Hi nsriharsha15,
Usually, Nb_LINE  is used to count the total number of records have been proceed.
When inserted item is choosen, there will be a global variale such as ((Integer)globalMap.get("tMysqlOutput_1_NB_LINE_INSERTED"))will be avaible, which counts the total number of records have been inserted into database.
The same to updated, deleted items.
Best regards
Sabrina
0683p000009MDl6.png
sasi8008
Contributor
Contributor

Hi, i have 200 jobs ,i need  find row count,retrieved records,updated records  and job  componentst to each job
I need to joblet a to get the info about all jobs
Is there any way to  create a joblet to  jobs. 
Using NB_LINES
Anonymous
Not applicable
Author

hi,
how do i print ((Integer)globalMap.get("tJDBCInput_1_NB_LINE"));
regards,
sagar jadhav.
Anonymous
Not applicable
Author

Hi,
You can use tfixedflow component to print  ((Integer)globalMap.get("tJDBCInput_1_NB_LINE")) into console.
Best regards
Sabrina
0683p000009MD3P.png
_AnonymousUser
Creator III
Creator III

How do I get a column count that is visible in the talend run console and move that to an email with some formatting? I am using GPLoad, and I see the row counts for insert/delete/update/error within the log file. My problem is that even with the errors, the job completes successfully (though no records are inserted), and there is no notification for me to know this was a failed job.  When I go back and take a look at the logs, I see the Error/insert/update counts, but it is a manual process for me. What I would like is to get the console message into email as an alert to particular list of users in case of job has not successfully added rows in the run.
So far, I have tried a tFileRowCount for the input csv file for gpload, and a select count(*) from target table, exporting that to a csv and running a binary tally between the two of them using tFileCompare, tAssert to throw up the match/mismatch, then tSendEmail. 
tfileinput(raw file used in gpload) -- tgpload--tgpinput (select count(*)) -- tfileoutputdelimited (2)
|
tFileRowCount--(raw file+ (2))
|
tfilecompare --tassert - tsendmail
I feel like I am adding extra steps. Please help me.. Thanks 0683p000009MACn.png
Anonymous
Not applicable
Author

Hi N00biETL,


 The tFlowMeterCatcher component catches the processing volumetric from the tFlowMeter component and passes them on to the output component.


You can use it in your work flow and send the number to you by using tsendmail component.


Best regards


Sabrina

Anonymous
Not applicable
Author

Using tWriteXML component I am able to get this Output
----------------------------------
<Contact>
<row no="1">
    <FL Name="Daouda Doumbia"></FL>
    <FL Email="test1@test1.com""></FL>
    <FL First_Name="Daouda"></FL>
    <FL Last_Name="Doumbia"></FL>
    <FL Phone="00001"></FL>
    <FL Area="509"></FL>
  </row>
<row no="2">
    <FL Name="Zamantungwa Sikosana"></FL>
    <FL Email="test@test1.com"></FL>
    <FL First_Name="Zamantungwa"></FL>
    <FL Last_Name="Sikosana"></FL>
    <FL Phone="0"></FL>
    <FL Area="(NULL)"></FL>
  </row>

</Contact>
------------------------------------------
But desired output is something like this
------------------------------------------
<Contacts>
<row no="1">
<FL val="First Name">Scott</FL>
<FL val="Last Name">James</FL>
<FL val="Email">test@test.com</FL>
<FL val="Department">CG</FL>
<FL val="Phone">989898988</FL>
<FL val="Fax">99999999</FL>
<FL val="Mobile">99989989</FL>
<FL val="Assistant">John</FL>
</row>
</Contacts>
------------------------------------
Is it possible to get this kind of output using any XML component or i have to write java code?
I am attaching my job design.

Regards
Gulshan
Anonymous
Not applicable
Author

Hi  Gulshan,
We can not see your job design on forum. Could you please attach it again?
Best regards
Sabrina