2 Replies Latest reply on Feb 5, 2014 11:59 AM by charis_dancer

    Find sum of two tables; display only if > 0 ?

    charis_dancer Level 1

      I am presently creating an order form in LiveCycle. Within it are two checkboxes: clothing and giftware.

       

      Each checkbox is tied to a table, visible or hidden, depending whether the box is checked. With me so far?

       

      The first table allows the user to specify color, style, quantity, list price, logo/insignia location, etc. on clothing. The user can add or delete rows, and the table calculates the total, sales tax and grand total on the fly. No problem.

       

      The second table allows the user to specify etching/engraving style, list price, quantity, logo/insignia size, etc. on giftware. The user can add or delete rows, and the table calculates the total, sales tax and grand total on the fly. No problem here either.

       

      Where I'm getting stuck is in creating a Grand Total numeric field (formatted for currency) that adds the totals from the two tables. Seems easy enough; however, it doesn't make sense to display this if the sum (the grand total of the first table and the grand total of the second table) is 0.

       

      Can someone kindly let me know how to find the sum of both tables and display the order total only if grandtotal > 0 ?

       

      Thank you.

        • 1. Re: Find sum of two tables; display only if > 0 ?
          radzmar Adobe Community Professional & MVP

          Hi,

           

          you can hide the 0 value when you add display patterns to your grand total field:

           

          null{}|zero{}|num{z,zzz,zz9.99 $}

          • 2. Re: Find sum of two tables; display only if > 0 ?
            charis_dancer Level 1

            Thank you for your suggestion. I'm not certain that it addresses my issue, however.

             

            The form has two check boxes: giftware, and clothing.

            • If the user checks giftware, the giftware table appears and he/she can enter values. The table is coded such that the footer row does $ = sum(Row[*].Pre-price) to determine the sub-total. The grand total for the table is calculated as the sum of 5% tax added to the sub-total.
            • If the user checks clothing, the clothing chart appears, and the user can enter values. The table is coded similarly to the giftware chart.

             

            Neither table is visible on initialization; each appears only if the corresponding check box is checked.

             

            There is a text field, not connected to either table, that will display the order total (giftware + clothing). However, it does not make sense to display this field at all on initialization or if the sum of the two table totals is 0.

             

            I hope I am clear in what's intended. If not, let me know.