Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a Fixed Width File with a bunch of Codes included in every column. They Range from A-Z and 1-9. They only contain One value for each column. I'm trying to create a string method where it will handle the NULL Data from the lookup table and if the value "X" in the table, Insert a "True" string value in the output file column. For some reason my output file is only returning False values for every row. Seems like its not recognizing my .equals("X") statement.
Can anyone assist with my current string method syntax to allow for true values to show when the right code value is returned in the column.
Relational.ISNULL( row4.X )?"False": ( row4.X .equals("X")?"True":"False")
Thanks,
Andrew
Hi Andrew,
The input file you have shared with me is a csv file where columns are separated by comma. So instead of tFixedFlowInput, you should use tfileinputdelimitedcsv.
Once you do this, you will get all the columns in right order. Please refer the tMap below where I have used the function in your job (Please note that I have made the change for column X only. You need to do the same for other columns if required.
The output is showing as True or False as showing below.
Hope I have answered your query 🙂
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 🙂
Try this:
Relational.ISNULL( row4.X )?"AAA": ( row4.X.equals("X")?"BBB":"CCC")
And check the result. If it returns BBB or CCC it means that system check row4.X.equals("X")
If result is AAA it means that row4.X IS NULL end system doesn't event check row4.X.equals("X").
Hi Andrew,
Could you please share a sample file with 3 records for verification from our end?
It should work properly. Also could you please print row4.X and the output of your expression side by side and check the results?
I believe there is some issue in input data parsing from your file and printing the data will give you some clue.
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 🙂
Hey Nikhil,
Here is my Output for my tFixedFlowInput/tMap/tLogRow component sequence. I attached 3 records of the input file to this post. Let me know if you're seeing an issue with the file.
Thanks,
Andrew
Hi Andrew,
The input file you have shared with me is a csv file where columns are separated by comma. So instead of tFixedFlowInput, you should use tfileinputdelimitedcsv.
Once you do this, you will get all the columns in right order. Please refer the tMap below where I have used the function in your job (Please note that I have made the change for column X only. You need to do the same for other columns if required.
The output is showing as True or False as showing below.
Hope I have answered your query 🙂
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 🙂