Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 Karthik_Kommarr
		
			Karthik_KommarrHello,
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
 prg
		
			prg
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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!!
 billimmer
		
			billimmer
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		you can do this in tmap. For example:
row1.City==null ? "City is null" : row1.City
 prg
		
			prg
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 Karthik_Kommarr
		
			Karthik_KommarrBut I also want if Address and City is null. then I want to have 'Address is null; City is null' in Error field
 Karthik_Kommarr
		
			Karthik_KommarrThanks 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.
 prg
		
			prg
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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!!
 Karthik_Kommarr
		
			Karthik_KommarrThis may work. Thanks.
