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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to return multiple columns value with if condition

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. 

Labels (2)
3 Replies
Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

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

TRF
Champion II
Champion II

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