Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to eliminate empty spaces

Featured Replies

Hi -
I use this calculation to display the value just if the variable have a value.  The problem is when the variable doesn't have a value the calculation add empty spaces to the result.
 
Case ( Length ( $i1 ) > 0 ; $i1 ) & ¶ & 
Case ( Length ( $i2 ) > 0 ; $i2 ) & ¶ &
Case ( Length ( $i3 ) > 0 ; $i3 ) & ¶ & 
Case ( Length ( $i4 ) > 0 ; $i4 ) & ¶ & 
Case ( Length ( $i5 ) > 0 ; $i5 ) & ¶ & 
 
If there is a better way to accomplish this I will appreciate your help.
Thanks
Case (
Length ( $i1 ) > 0 ; $i1  & ¶ & ;
Length ( $i2 ) > 0 ; $i2  & ¶ &
Length ( $i3 ) > 0 ; $i3  & ¶ & ;
Length ( $i4 ) > 0 ; $i4  & ¶ & ;
Length ( $i5 ) > 0 ; $i5  & ¶ & ;
""
)
 The problem is when the variable doesn't have a value the calculation add empty spaces to the result.

 

No, that's not what happens. The calculation may add empty rows to the result, not spaces. This could be eliminated by moving the carriage returns inside the Case() function =

Case ( Length ( $i1 ) > 0 ; $i1 & ¶ ) &
Case ( Length ( $i2 ) > 0 ; $i2 & ¶ ) &
Case ( Length ( $i3 ) > 0 ; $i3 & ¶ ) &
Case ( Length ( $i4 ) > 0 ; $i4 & ¶ ) &
Case ( Length ( $i5 ) > 0 ; $i5 )

or doing something much more simple =

List ( $i1 ; $i2 ; $i3 ; $i5 ; $i5 )

A note on my previous post. The Case function will go in logical order. Once it finds a true statement, it won't evaluate the rest. My post is for one calculation field. If you want it to check each separate variable, you'd have to do each one individually, either by a separate calculation or a separate script step. 

 

Example:

 

Case (

Length ( $i1 ) > 0 ; $i1  & ¶ & ;

""

)

 

______________________________________________________________

 

Case (

 Length ( $i2 ) > 0 ; $i2  & ¶ &

""

)

Case (

Length ( $i1 ) > 0 ; $i1  & ¶ & ;

""

)

 

That's an invalid expression (which BTW appears also at the end of OP's formula).

 

 

In addition, when using Case(), an empty default result is entirely redundant.

  • Author

Hi - Reid

 

Thanks for reply to my topic.

I tried your suggestion but something is missing

  • Author

Thank you both for your help ;-)

Thanks for the correction comment! I didn't realize empty result was not needed. Putting the ¶ inside the case function makes much more sense. 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.