Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
My requirement is check null in multiple columns, if null found in any column then mention the reason in error column. Do I need to write java code for that, or I can do it in tmap itself?
Kindly suggest.
For example 1:
Source:
ID Name Address City
1 Century abc
***********************************
Output:
ID Name Address City Error
1 Century abc City is null;
For example 2:
Source:
ID Name Address City
1 Century
***********************************
Output:
ID Name Address City Error
1 Century Address is null; City is null
Hello @Karthik Kommarraju ,
You can create an expression using a ternary operator according to your requirement;
For example;
(row1.city==null && row1.address==null) ? "City and address is null"
: row1.city==null ? "City is null"
: row1.address==null ? "Adddress is null"
: "No Error"
Please note this is the sample expression. You can build your expression as per your needs.
Thanks!!
you can do this in tmap. For example:
row1.City==null ? "City is null" : row1.City
Hello @Karthik Kommarraju,
Yes, this can be achieved using tMap.
You can check the source column if it is null and then print using expression builder in tmap.
row1.city==null ? "city is null" : row1.city
Please check the screenshots.
Let us know if it helps and then mark your case as solved (Kudos also accepted).
Regards,
Vaishnavi
But I also want if Address and City is null. then I want to have 'Address is null; City is null' in Error field
Thanks Vaishnavi. But I also want if Address and City is null. then I want to have 'Address is null; City is null' in Error field. Please check example 2.
Hello @Karthik Kommarraju ,
You can create an expression using a ternary operator according to your requirement;
For example;
(row1.city==null && row1.address==null) ? "City and address is null"
: row1.city==null ? "City is null"
: row1.address==null ? "Adddress is null"
: "No Error"
Please note this is the sample expression. You can build your expression as per your needs.
Thanks!!
This may work. Thanks.