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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to count yes/no in Talend

I have a table containing a column with values Yes,No or N/A. I want to count the number of Yes and Number of No in that table and add that value in a different table in such a way that, the new table has one column with count of Yes and other column has count of No.
Labels (1)
  • v7.x

2 Replies
Anonymous
Not applicable
Author

Hi
Read the data of this column from database, and use tAggregateRow to count the number of each value, set this column as group by column. About AggregateRow component, please refer to the component documentation on Talend Help Center.
https://help.talend.com/reader/Xr~HqMTCU7gC3dT5ZSikKQ/tq67T06xho7FrkCyFcLfbw

Please try and let me know if you any questions.

Regards
Shong
billimmer
Creator III
Creator III

Something easy you can do.  Use a query similar to this in your tDBInput component:

 

SELECT
(select count(*) from mydb.myschema.mytable where myfield = 'YES') as "Yes Column",
(select count(*) from mydb.myschema.mytable where myfield = 'NO') as "No Column";

 

write the results to a new table with tDBoutput....

 

tDBInput -----main------>  tDBoutput