Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
abhi90
Creator II
Creator II

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,@TRF,@vboppudi
Labels (2)
8 Replies
vboppudi
Partner - Creator III
Partner - Creator III

Hi,

 

are you looking foe the following output?

0683p000009Lwzq.png0683p000009Lwzv.png

Regards,

abhi90
Creator II
Creator II
Author

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

vboppudi
Partner - Creator III
Partner - Creator III

Please provide some sample source data.

 

Regards,

abhi90
Creator II
Creator II
Author

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)

vboppudi
Partner - Creator III
Partner - Creator III

Hi,

 

Please see below

0683p000009Lwng.png

 

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

Regards,

abhi90
Creator II
Creator II
Author

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


tmap_fail.JPG
tmap_pass.JPG
vboppudi
Partner - Creator III
Partner - Creator III

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,

 

abhi90
Creator II
Creator II
Author

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. 0683p000009MACn.png