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: 
lennelei
Creator III
Creator III

Boolean aggregation?

Hi,
Is there any way to use tAggregateRow or a similar component to manipulate boolean data?
For example, I've got a job that produces a row with three columns: filename (String), test_id (String), test_result (Boolean).
I would like to know for each filename, if there any true test_result to reject the file.
At first, I wanted to use this:
tFilterColumns (keeping filename and test_result columns) -- row --> tAggregateRow (max or sum or whatever on the test_result column using filename as key)
But it seems that tAggregateRow doesn't manipulate Boolean despite this note I found ( https://jira.talendforge.org/browse/TDI-643).
Any other component for that or do I have to convert Boolean type to Integer?
Regards.
Alexis
Labels (2)
2 Replies
Anonymous
Not applicable

Hi,
Have you tried to use tMap component with expression? What's your input source?
Best regards
Sabrina
lennelei
Creator III
Creator III
Author

Hello,
I'm not sure to understand what you mean by "use tMap component with expression"? I already have tMap in the full job, but I don't see how they could help me here?
Here is an example of data:
input :
 filename | test_id | test_result
----------+---------+-------------
a.csv | TEST1 | false
a.csv | TEST2 | false
a.csv | TEST3 | false
b.csv | TEST1 | false
b.csv | TEST2 | true
b.csv | TEST3 | false
c.csv | TEST1 | true
c.csv | TEST2 | true

output (test_result is an "OR" between all test_result values for a specific file) :
 filename | test_result
----------+-------------
a.csv | false
b.csv | true
c.csv | true

If I replace the Boolean values with Integer (true = 1 / false = 0), I can use a tAggregateRow with a max(test_result) and filename as key.
Regards.
Alexis