Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am concatenating 2 fields using an expression in an multiselect list box , the fields might be having some nulls , how do i avoid the nulls , the expression does not appear in presentation tab to select avoid null option , how do i avoid null for an expression?
Here is my expression:
=(field1 &'-'& field2)
Thanks
You can try this.
=If(Not IsNull(field1) and Not IsNull(field2),field1&' - '& field2)
Hi,
U can use expression to conver null like if(isnull(field1,'-',field1) & '-' & if(isnull(field2,'-',field2)
this is the solution as per my understanding ,please le me know it is right or not. Expalin ur ssue in more details.
I get an error with the above expression may be ) is missing i tried adding that , still did not work , i requirement is pretty simple, i just want to concatenate 2 fields with ''-" a hyphen in the middle and avaoid null in both the feilds.
Thank you..
It's not clear whether you are doing that in the script. If this is the case, then something like the following should work:
Table:LOAD If(Len(Field1) > 0, Field1, 'Null') & '-' & If(Len(Field2) > 0, Field2, 'Null') AS CompositeFieldFROM data.source
Instead of the "Null" set any value should a field is empty so you can easily check it later.
This will work as expression, although it will affect severely in the document performance.
Hope that helps.
No way to have this as a expression?
I get value Null-Null in my list box if i use above as an expression
You can try this.
=If(Not IsNull(field1) and Not IsNull(field2),field1&' - '& field2)
Attached is the sample application. Works fine with both script and expression. By default (when nothing is selected) "Null-Null" is displayed, since the expression is made of different fields.
I always use Len() > 0 rather than IsNull() since the "null" values depend on the database, driver, computer... Len() always returns proper results.
Regards.