Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
How to return multiple column values with if condition?
Currently I wrote like below and it is giving me error.
The logic is subscriber info is null then return SP_SERV_ID, SITE_A_ID AND SUB_ACCOUNT field values.
row1.SUBSCRIBER == null ? row1.SP_SERV_ID, row1.SITE_A_ID, row2.Sub_Account
: null
Any help is much appreciated.
What exactly are you trying to do? It looks like you are trying to actually apply logic to returning a row based on a column values. This can be done using the filtering in a tMap component. Can you give a bit more information on this. There will be a way of doing this, but we need a bit more info.
Hello,
Thanks for the response.
Here is what I am trying to achieve.
row1.SUBSCRIBER == null ? row1.SP_SERV_ID ||
row1.SUBSCRIBER == null ? row1.SITE_A_ID ||
row1.SUBSCRIBER == null ? row2.Sub_Account
: null
When I tested this I get below error,
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Requirement:
If Subscriber is null then return serv_id, site_a_Id, sub_account
else Null
Regards,
Deepak
Hi,
What do you want to do?
Do you want to concatenate SP_SERV_ID, SITE_A_ID and Sub_Account?
In this case, try this:
row1.SUBSCRIBER == null ? row1.SP_SERV_ID + row1.SITE_A_ID + row2.Sub_Account : null