Jump to content
  • 0

Remove Spaces from Basic Formula If Field Is Null


kpcollier

Question

I have this basic table formula:

IsNull([@field:Section_String], '') + ' ' + 
IsNull([@field:Manuf_String], '') + ' ' + 
IsNull([@field:Category_String], '') + ' ' + 
IsNull([@field:SubCat_String], '') + ' ' + 
IsNull([@field:Description], '') + ' - ' + 
IsNull([@field:Finish], '')

However, if one of the fields is null, the space is still there. This leaves a double space in the middle of the value.

Anyone have any ideas how to get rid of the space following a field if it is null?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

I removed the IsNull from each field and wrapped the whole formula in a couple of replace() method.

replace(replace(replace(([@field:Section_String] + ' ' + [@field:Manuf_String] + ' ' + [@field:Category_String] + ' ' + [@field:SubCat_String] + ' ' + [@field:Description] + ' - ' + [@field:Finish]),' ','<>'),'><',''),'<>',' ')

Since the value would just be blank if the field is empty anyways, IsNull isn't needed. Then, the replace method will make any double/triple spaces into a single space.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...