May 16, 201411 yr 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
May 16, 201411 yr Case ( Length ( $i1 ) > 0 ; $i1 & ¶ & ; Length ( $i2 ) > 0 ; $i2 & ¶ & Length ( $i3 ) > 0 ; $i3 & ¶ & ; Length ( $i4 ) > 0 ; $i4 & ¶ & ; Length ( $i5 ) > 0 ; $i5 & ¶ & ; "" )
May 16, 201411 yr 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 )
May 16, 201411 yr 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 & ¶ & "" )
May 16, 201411 yr 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.
May 16, 201411 yr Author Hi - Reid Thanks for reply to my topic. I tried your suggestion but something is missing
May 16, 201411 yr 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