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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Ternary notation help needed...

I am trying to create a variable in the tMap component, which will allow me to test the contents of two input fields from tOracleInput, and output a 1 or 0 based on the result.

I've used a number of variations of notation but none of the,m seem to be giving me the result I expect (and know). Can anyone advised what I need to change in the below:

 

(FirstOfMonth.VEHICLE_DRIVEABLE=="N"&&FirstOfMonth.BOOKING_IN_DATE!=null)?1:0

 

Thanks in advance.

Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Hi,

You should never compare 2 strings using the "==" operator:

("N".equals(FirstOfMonth.VEHICLE_DRIVEABLE) && 
 FirstOfMonth.BOOKING_IN_DATE != null) ? 1 : 0

Hope this helps.

View solution in original post

2 Replies
TRF
Champion II
Champion II

Hi,

You should never compare 2 strings using the "==" operator:

("N".equals(FirstOfMonth.VEHICLE_DRIVEABLE) && 
 FirstOfMonth.BOOKING_IN_DATE != null) ? 1 : 0

Hope this helps.

Anonymous
Not applicable
Author

Legend - works a treat.

 

Thanks very much!