Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

percent calculation

Avatar

Former Community Member
I have a form where I need to add the dollar amounts for projected small business spend and large business spend. (which is entered by the user) Then, actual cumulative smal and large spend is also entered by the user.



I need to know how to write the script for calculating the percentage of cumulative spend in relation to projected spend.



cumulative spend = % of projected spend

Projected spend = 200.00

50.00 is what % of 200.00



Here is the code I tried:



if(TotalCurrent ne 0) then

(SmallActual / TotalCurrent) * 100

else

null

endif



Here is the error:



Script failed (language is formcalc; context is

xfa[0].form[0].topmostSubform[0].Page1[0].SmallActual[0])

script=endif

Error: syntax error near token 'endif' on line1, column 5.



Any help is appreciated. I am new to this program.
0 Replies