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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Handling NULLS with also getting the right output in tMap String Method

 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.

0683p000009M2sh.png

Relational.ISNULL( row4.X )?"False": ( row4.X .equals("X")?"True":"False")

 

Thanks,

 

Andrew

Labels (1)
  • v7.x

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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.

 

       

0683p000009M2kH.png

 

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.

0683p000009M0wY.png

 

The output is showing as True or False as showing below.

0683p000009M2t2.png

 

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 🙂

 

View solution in original post

4 Replies
Anonymous
Not applicable
Author

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").

Anonymous
Not applicable
Author

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 🙂

 

 

Anonymous
Not applicable
Author

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.

 

0683p000009M2un.png0683p000009M2dT.png0683p000009M2nY.png

 

 

Thanks,

 

 

Andrew


donorflag.csv
Anonymous
Not applicable
Author

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.

 

       

0683p000009M2kH.png

 

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.

0683p000009M0wY.png

 

The output is showing as True or False as showing below.

0683p000009M2t2.png

 

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 🙂