Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello. See my source table:
Product | US | UK | Canada |
X | TRUE | FALSE | TRUE |
X | FALSE | TRUE | TRUE |
Y | FALSE | FALSE | TRUE |
Z | FALSE | TRUE | FALSE |
Y | FALSE | FALSE | FALSE |
X | FALSE | TRUE | FALSE |
As you can see I have multiple rows for same product. Im trying to aggregate rows based on Product and the logic should be IF there is at least one row where Product/Country = TRUE then in aggregated result it is always TRUE, otherwise FALSE. I can see components like tAggregateRow where I can use some operations like sum, max, etc but I cant specify some logical question like I described.
So in the end Id like to have output table as follows:
Product | US | UK | Canada |
X | TRUE | TRUE | TRUE |
Y | FALSE | FALSE | TRUE |
Z | FALSE | TRUE | FALSE |
Can anyone help? Thank you very much
I created a simple job based on your sample table, using the "max" function of tAggregateRow and got the results you wanted.
How? I have tried that before but Im getting warning below:
The operation 'max' for the output column 'Canada' can't be processed because of incompatible input and/or output types (for each country)
From which I understood aggregate operations cant be ran on boolean or string
I have mine set up as string datatype for both input and output and it's working.
I am not sure how it would handle boolean, or if that is possible.