Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Replacing null values in Multibox

Hi ,

          I have a multibox there I have used some feilds for selection from those for one filed whenever  we clicks on that field the first two values are empty(null values) there i want display some text like Undefined for those Null values.. How can we do this.......

I was tried the  below if condition but its not working..............

if(isnull("X_COMNT")=-1, Undefined, X_COMNT) as X_COMNT,  but while reloading the script there I  get a error like field not found.....

Regards,

Anil.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi

Try this

If(Trim([X_COMNT]) = '' OR IsNull(X_COMNT), 'Undefined',X_COMNT) AS X_COMNT

Regards

Ashok

View solution in original post

5 Replies
Not applicable
Author

You may need to put the undefined in single quotes as it is a literal string value..

if(isnull("X_COMNT")=-1, 'Undefined', X_COMNT) as X_COMNT

Anonymous
Not applicable
Author

Hi

Try this

If(Trim([X_COMNT]) = '' OR IsNull(X_COMNT), 'Undefined',X_COMNT) AS X_COMNT

Regards

Ashok

Not applicable
Author

Yes chandashok is essentially correct - I did not notice the Isnull(XXX)=-1.

To expand on what he said and take into account the -1

If(Trim([X_COMNT]) = '' OR IsNull(X_COMNT) OR X_COMNT = -1, 'Undefined',X_COMNT) AS X_COMNT

First condition checks if it is a blank or string of spaces, second if it is a null, third if it is equal to -1.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     I think Null values wont get display in listbox it will be whitespaces try with trim()

     =If(trim(X_COMNT)='','Undefined', X_COMNT)

Then no need to use the field name inside the double quotes when using within most of the functions.

Celambarasan

Not applicable
Author

thnx for all replies now its working fine.........

Regards,

Anil