One Star

Filter row by comparing two columns

Hi All,
I have an issue in which i need to filter rows that figure from columns A must be greater or equal to column B. If not, i don't want it. See example below:
Input
------
column A column B
---------- ----------
1A 1B
1A 2B
1A 3B
2A 1B
2A 2B
2A 3B
Expected Output
-----------------
1A ............. 1B
1A ............. 2B
1A ............. 3B
2A ............. 2B
2A ............. 3B
Plz help me Smiley Sad
Regards,
KAL
5 REPLIES
Moderator

Re: Filter row by comparing two columns

Hi,
This forum Forum 28580 might point a light to you.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Filter row by comparing two columns

Hi Sabrina,
Thanks for your response. I already used other way to solved it but the solution that you advised me to refer is good. It is helpful for my etl job enhancement Smiley Happy
Thanks again
Kal.
Moderator

Re: Filter row by comparing two columns

Hi kal,
Thanks for your feedback. Would you mind sharing your solution with us?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Filter row by comparing two columns

Hi Sabrina,
Since i wants to filter a row based on condition where value in column A must greater or equal to column B, only then i read the rows (VALUE) or else i will not read it.
What I've done is (by using tMap) i add another columns C and inside the expression of column C, i put a condition as per below:
column A >= column B ? VALUE : null
Then i used tFilterRow to filter column C not equal to null.
Smiley Happy
Regards,
Kal
Moderator

Re: Filter row by comparing two columns

Hi,
Thanks for sharing your experience with us , it is a good solution.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.