Compare current date to yesterday and if two fields are the same then set another record to +1

Four Stars

Compare current date to yesterday and if two fields are the same then set another record to +1

OK all smart people Smiley Happy

 

I am struggling with using tMap and tJavaRow and tAggregate for the below.
What I am trying to accomplish is I am trying to look at the current date and see if yesterdays date has the same values for RuleName and AccountNumber and if it does then the field CountByKDE gets a +1 value (so if it was 0 it goes to 1, if it is 2 it goes to 3) up to the value of 5 then an email will go out.  I already have the email job done.  How do I accomplish this please help.

Chantelle

Employee

Re: Compare current date to yesterday and if two fields are the same then set another record to +1

Hi,

 

    You can store the RuleName and AccountNumber to two context variables. Similarly, store the CountByKDE  value also to the context variable. Now, in the tjavarow, write a java if condition which will match the incoming record with context variables for RuleName and AccountNumber. 

 

    If it matches, increment the current value by 1. Connect to email job with a Run if condition and inside Run if condition, check the value of CountByKDE  variable. That way, you can control the job call to email component.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog