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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Count number of rows in a file and sent the total in an email

Hello,
I am trying to count the number of rows in a file and send that total in an email.
So far my approach has been to use a tAggregateRow on the tFileOutput to get the count.  Is there a way using tSetGlobalVar to get the count value from the tAggretateRow and insert that into the “Message” section of the TSendMail?
My layout is as follows tFileOutput -> tAggregateRow -> tSetGlobalVar -> tSendMail
If this layout will work should the Value under tSetGlobaVar be set to something like “tAggregateRow”
Thanks
Labels (2)
1 Solution

Accepted Solutions
talendtester
Creator III
Creator III

Wouldn't it be easier to use the tFileRowCount component?
You can display the result via tJava:
System.out.println(globalMap.get("tFileRowCount_1_COUNT"));
https://help.talend.com/search/all?query=tFileRowCount&content-lang=en

View solution in original post

2 Replies
talendtester
Creator III
Creator III

Wouldn't it be easier to use the tFileRowCount component?
You can display the result via tJava:
System.out.println(globalMap.get("tFileRowCount_1_COUNT"));
https://help.talend.com/search/all?query=tFileRowCount&content-lang=en
Anonymous
Not applicable
Author

Hi,
You don't need to use the global variable. You can put in the tSendMail the value straight from tAggregateRow/tFileRowCount using following format: output_name.output_column_name (for example row1.count_rows).
If the returned count value is Integer you need to convert it to string String.valueOf(row1.count_rows).