Problems when calculating expression

T

Tom

Hi,
We defined new repeating table with couple of columns but due to some error, we could not get correct expression on Final Total field. The final total field is based on Field SubTotal + Taxes + Freight. The field subtotal is derived by expression sum(field x) and the value gets populated correctly. The other problem is field Tax which is calculated as 6% of SubTotal. Can you please help as we are trying to resolve for last couple of days.

Thanks
Tom
 
J

Josh Bertsch [MSFT]

Since you have the SP1 Preview, you can use text boxes to store your
calculations in the XML. Unlike Expression Boxes, the stored XML data from
one calculation can be used in another.

I would recommend you set your calculations as such:

Instead of using an Expression Box for the 'Subtotal', insert a text box in
its place. Open the text box properties and click on the "Fx" button. This
will bring up the formula builder. Click on "Insert Field or Group..." and
choose the field that you want to sum. Place sum() around it and you have
your first calculation!

Next, insert a text box for the "Final Total" and build your expression in
the same manner. This time choosing all of the fields that are part of the
"Final Total".

Insert another text box for your "Tax" field and simply multiply the
subtotal field by .06.

You should be all set at that point!

--josh bertsch
Software Test Engineer
Microsoft InfoPath

Tom said:
Hi Greg

Thanks for your mail.

We had installed Infopath sp1 from microsoft web site today. As stated in
earlier mail, Subtotal field stores result based on expression value. The
expression used for Subtotal field is sum(field a). We need to calculate
the Final Total based on Sub Total + Freight. Can you pls let me know the
syntax for same. Another question as stated in earlier mail, we wish to
calculate Tax field , which is based on 6% of Sub Total. If you can please
let us know the syntax, it would be great.
Thanks for all your help
Thomas
expression boxes because those values are not stored anywhere. In SP-1 you
can have a field that is populated using an expression, then that value is
stored and can be used elsewhere.triggers the subtotal to update. The subtotal triggers a tax update, and the
tax and freight fields trigger a total update.
Or you can use OnAfterChange event handlers and perform all of these calculations and updates via code.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



Hi,
We defined new repeating table with couple of columns but due to some
error, we could not get correct expression on Final Total field. The final
total field is based on Field SubTotal + Taxes + Freight. The field subtotal
is derived by expression sum(field x) and the value gets populated
correctly. The other problem is field Tax which is calculated as 6% of
SubTotal. Can you please help as we are trying to resolve for last couple of
days.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top