One Star

[resolved] Data Validation

Dear all,
I am new to Talend and have probably a very simple question.
Using a delimited file; there is a column named UserName. Each username must start with an "S" and it's length must be 5 characters.
How to validate and ensure that rejected records are omitted?
Thanks,
Kees
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] Data Validation

Sorry, I was referring to the above identified .... with the new setup all works fine ... there are multiple ways that lead to Rome, so to speak Smiley Happy
Thanks all for the help
11 REPLIES
Moderator

Re: [resolved] Data Validation

Hi,
Welcome to Talend Community !
tFilterRow or tMap component can fit your need. I create an example job to show you how to add filter expression on tMap to filter rows, the job design looks like:
tFileinputdelimited--main-->tMap--main-->tLogrow
Set the filter expression on tMap as:
 row1.data.startsWith("S")&&row1.data.length()==5

Please see my screenshots for details.
As a newbie, I encourage you to read the online manual of tMap and tMap operation.
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: [resolved] Data Validation

Hi Sabrina,
Thanks so much for the reply. I have looked matters up indeed but now am struggling with a bit of another issue.
In my TMap I have a default data conversion .... TalendDate.parseDate("dd/MM/yyyy",row1.Date) the input date comes from a delimited file in the format of "20/02/2012" ergo as per this format. Yet I receive the error upon test as follows: Exception in component tRowGenerator_1.
I get the same error when I parse an string to integer.
Looking forward to your reply ... since tomorrow I am suppose to demo the product to management for acceptance.
Community Manager

Re: [resolved] Data Validation

Hi CPA_Talend
The exception occurs on tRowGenerator_1, there must be something wrong in the parameter setting, we usually click the Preview button to see if the data can be generated. If this button does't work in your side, please upload a screenshot of tRowGenerator setting window, it will be helpful for us to address the problem.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Data Validation

Hi Shong,
Please see below
Moderator

Re: [resolved] Data Validation

Hi,
Unfortunately, the screenshot you provided in #5 is not the screenshot of tRowGenerator setting window as @shong said. It is still the tMap. In your workflow, you have used component tRowGenerator as your input and something wrong with it (Exception in component tRowGenerator_1.) .
The screenshot should be as the follows.
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: [resolved] Data Validation

Hi,
I wish that to be the case but I do not use the TRowGenerator component anywhere ... hence I am confused...
Moderator

Re: [resolved] Data Validation

Hi,
The problem may be occur in it if you don't use component tRowGenerator.
By the way, talend provide training to community user for the study of talend products.
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.
Seven Stars

Re: [resolved] Data Validation

The Test! button in Expression Builder doesn't work and never has. I can't understand why Talend doesn't get rid of it as this question keeps coming up on the forum! To test, you have to run the job.
One Star

Re: [resolved] Data Validation

Thanks all,
I build around it ... that seemed to work ... basically, I now do all conversions ahead of mapping activities and keep tMap as much as possible for it's job.
However it remains a little weird.
Moderator

Re: [resolved] Data Validation

Hi,
What is the weird issue? Any screenshot for it ?
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: [resolved] Data Validation

Sorry, I was referring to the above identified .... with the new setup all works fine ... there are multiple ways that lead to Rome, so to speak Smiley Happy
Thanks all for the help