Knackly Formula for Totaling Costs in Tables
This guide will teach how to total costs in a table. You can watch the accompanying video here:
There are multiple scenarios in which you may use a table to keep track of specific item's costs. Knackly can total the costs of these items. Our example walks through a retainer with different options of cost.
First, navigate to the Designer tab in the online workspace. Select Add a new element. Name the element and select Model. In our example, we named the model engagement with the initial letter lowercase.
Inside this new model, create any variables you need. In our example, we created two: a single date variable: EngagementDate, and a list of selection variable: CaseOptions.
In the CaseOptions variable under the Select From section, select Options defined below. Note that you can create a separate table in the Elements tab, but in our example, we created a simple table with the columns Name and Cost.
Navigate back to your main catalog and create a new object variable that calls on the engagement object model.
Return to the template you are working on. Insert the list into the table you are creating. Note that you will need to insert Name and Cost separately.
Save and sync the Knackly Word Designer. Run the app intake. The Engagement section will now appear as a pop-up.
Now that the costs are in Knackly and the template, we need to add the formula for totaling the cost. Navigate to the catalog you are working in and select the Formulas tab.
Select Add a new formula and create the formula. Use the sidebar on the left to find any variable names you may need. The expression for our example looks like:
Engagement.CaseOptions | reduce: _result + Cost.toInt(): 0
Navigate to the template and add the TotalRetainer formula. You can also add in any formatting.
Run the app intake and download the finished document. It should look like the following:
Since the total cost appears in the finished document, you can choose to stop editing here. If you wish to add the total cost to the app intake, use the following steps.
In the engagement model, navigate to the Layouts tab. Drag the icon next to drag to create an information cell… into the Layout section. Organize it however you feel best.
Be sure to include the formula title, TotalRetainer. Add any formatting you wish. Select Save.
Navigate to the app intake. In the Engagement pop-up, you will now see the total.
Please let us know if you have any comments or suggestions on how to improve this guide.