Seven Stars

Date Column value rejection using TalendDate.isDate

Hi All,
I have a scenario where I am converting My Date Column from String to Date. Now if any other format Date comes it will go to error Table.
I am converting String to Date in tmap variable port using below
Var1=talenddate.Formatdate("MM/dd/yyyy",Talenddate.paresedate(datecolumn,"MM/dd/yyyyy"))
Var2(where validating date)=Talenddate.isdate(Var1,"MM/dd/yyyy")
Now in Pass and fail output Table of tmap condition given Var2==true and Var2==false
Now data in datecolumn is converting and going properly to original Table. But for negetive Testing Part if any data is like 2016/22/25 it is not going to Error Table. Can anybody please help
@rhall_2_0,@TRF,@vboppudi
1 ACCEPTED SOLUTION

Accepted Solutions
Nine Stars

Re: Date Column value rejection using TalendDate.isDate

Hi,

 

Please see below

DateValidation3.PNG

 

Filter logic: TalendDate.isDate(row2.inDate,"M/d/yyyy",true) 

Regards,

Veeru Boppudi
8 REPLIES
Nine Stars

Re: Date Column value rejection using TalendDate.isDate

Hi,

 

are you looking foe the following output?

DateValidation1.PNGDateValidation2.PNG

Regards,

Veeru Boppudi
Seven Stars

Re: Date Column value rejection using TalendDate.isDate

Hi @vboppudi,

Using this. But all data going to error Table Now.

TalendDate.isDate(row1.MONTH_OF_DATE,"MM/dd/yyyy",true). Data is in MM/dd/yyyy

Nine Stars

Re: Date Column value rejection using TalendDate.isDate

Please provide some sample source data.

 

Regards,

Veeru Boppudi
Seven Stars

Re: Date Column value rejection using TalendDate.isDate

Hi @vboppudi,

Please find it

3/1/2016
4/1/2016
5/1/2017
2016/22/35

Top 3 should go to Normal and Below One 2016/22/35 should go to error. Input coming to tmap is String and converting that to Date using TalendDate.parseDate("MM/dd/yyyy",row1.MONTH_OF_DATE).

This is the Boolean Variable Port condition for seggregating data

TalendDate.isDate(row1.MONTH_OF_DATE,"MM/dd/yyyy",true)

Nine Stars

Re: Date Column value rejection using TalendDate.isDate

Hi,

 

Please see below

DateValidation3.PNG

 

Filter logic: TalendDate.isDate(row2.inDate,"M/d/yyyy",true) 

Regards,

Veeru Boppudi
Seven Stars

Re: Date Column value rejection using TalendDate.isDate

Hi @vboppudi,

I inserted 35/2017/22 this record in my file. It went to reject. But going there It converted to something like this 5/10/0030. I am taking My date Column to tmap Pass and ERROR Table of Output and converting there using TalendDate.parseDate("MM/dd/yyyy",row1.MONTH_OF_DATE). Snapshots attached

Nine Stars

Re: Date Column value rejection using TalendDate.isDate

Are you trying to convert invalid dates to specific format?

 

If yes, that is not going to work because you don't know the format input value coming.

 

Please let us know you exact requirement.

 

Regards,

 

Veeru Boppudi
Seven Stars

Re: Date Column value rejection using TalendDate.isDate

Hi @vboppudi,

Yess You were right. I was trying to convert Invalid Date to Right Format which was causing Issue. Changing Datatype to String in Error Table and dragging from Input Date Column to ERROR Table DateColumn Port of tmap resolved my Issue. Marking the Post as resolved. Smiley Happy