Expand my Community achievements bar.

Attention: Experience League Community will undergo scheduled maintenance on Tuesday, August 20th between 10-11 PM PDT. During this time, the Community and its content will not be accessible. We apologize for any inconvenience this may cause.

Cannot Suppress Zeros in Calculated Fields

Avatar

Former Community Member
I have searched the forum, and it seems that I am not the only one who has had this problem; and no one has been able to come up with an answer to any of the posts. When you have a calculated field with a set value on one side of the calculation, the field will always show up zeros. There should be a way (if there is a way, I haven't found it anywhere!) to suppress zeros in calculated fields.
5 Replies

Avatar

Former Community Member
I'm not sure I understand. You want the field to be blank when the calculation turns out to be 0? Just have the calculation script return null instead of 0.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
I haven't figured out how to do that. I am designing a form that has calculated fields much like an invoice voucher. The first column is number of units (pages). The second column is # of units multiplied by $1.80 (price per page). I know how to write the script to calculate; however, I want the total to be blank if there is no amount entered in column one. I have set this up so many different ways and nothing has worked. It seems that as long as there is a value in one side of the calculation, the total field will show $0.00. How do you make the calculation script return null instead of zero?



Here's what I am doing:

Column 1 - numeric field (pages1)

Column 2 - numeric field (costpages)

(In FormCalc: pages1 * 1.80)



It is an invoice voucher with several columns. They might have need to use one row or 10 rows. If they only need one row, the remaining nine rows show $0.00 in the column all the way down. I just want them to be blank.



Any help would be appreciated!

Avatar

Former Community Member
Your script would look something like this:



if (conditions) then

x * y //or whatever calculation

else

null

endif



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
I am not a programmer and I have the same question. Can you write a more specific script? I don't even know what language that is in.



(The conditions are the same as the OP, where the first field is quantity, the second field is price, and I want the third field to multiply those 2 columns only if they are not blank.)



Thank you.

Avatar

Former Community Member
Here's what I'm trying that is not working:



if (text50 = "not null") then

(text50 * text52)

else

null

endif



I know you don't have parentheses around your calculation, but that gave me a syntax error.