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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
djugal
Contributor III
Contributor III

regex in tmap for string to double check

Hi,
i have a string field as as input.
i want to check in tmap is Double with help of regex. how can i do it.
Also string to date in format "yyyy-MM-ddTHH:mm:ss"
Regards,
Jugal
Labels (2)
8 Replies
djugal
Contributor III
Contributor III
Author

ok so i found for date i can use the function Talend.isDate()
but need help for double check
djugal
Contributor III
Contributor III
Author

found it too:
row1.num.matches("-?\\d+(.\\d+)?")
djugal
Contributor III
Contributor III
Author

found that function Talend.isDate() doesnt help,
string is input,
date is out put in format "yyyy-MM-dd'T'HH:mm:ss"
how can i apply filter if string is date or not in tmap
Anonymous
Not applicable

Hi Jugal
I think it works fine.
My input string is "2012-04-13T14:17:22".
The expression in tMap is TalendDate.isDate(row1.newColumn,"yyyy-MM-dd'T'HH:mm:ss").
And the result is true.
Or I misunderstand what you mean.
Regards,
Pedro
djugal
Contributor III
Contributor III
Author

yeah thts correct,
but i want the rejected records to be deleted,
so wat i did is in the main output i keep the filter TalendDate.isDate(row1.newColumn,"yyyy-MM-dd'T'HH:mm:ss")
for the 2nd out in the tmap i select "Catch output reject"
& tht out frm the tmap is directed to delete rows db2 output
but somehow allows all the rows valid
Anonymous
Not applicable

Hi
'Catch output reject' will work when there is join in tMap.
Why don't you use the filter expression as below in out2?
TalendDate.isDate(row1.newColumn,"yyyy-MM-dd'T'HH:mm:ss")==false

Regards,
Pedro
djugal
Contributor III
Contributor III
Author

sorry it was typo error in tmap filter
thx for the help
Anonymous
Not applicable

Hi,
    I m new to Talend.I need to use Data quality regular expression in data integration job for filtering datas. any one help me