Is there a way to total several numeric variables?

May 17, 2015

Hi Everyone

Attached is a screen shot of the two columns with 9 numeric entries. Is there a variable I can add that will display a single total for each column?

12 Replies
Kevin Thorn

HI Karel,

What Wendy said ^

I refer to this as "Set & Pass." To help think through your logic, remember that variable can only hold one value at a time. In order to get one variable's value into another we first have to set it and then pass it (add) to another variable. 

Wendy's solution demonstrates that concept exactly. 

  • SET: Adjust Variable [1A] equal to the typed value when the control loses focus
  • PASS: Adjust Variable [TotCol1] +Add (the value of) [1A] when the control loses focus
  • Rinse & Repeat the above two triggers for each Data Entry field in each column

In Wendy's example the Total variable will keep adding values as the user enters a value in each of the Data Entry fields. 

If you want the learner's to first enter values in all the fields and then click a button to add them all at once to the Total value, it would look like this:

  • SET: Adjust Variable [1A] equal to the typed value when the control loses focus
  • Rinse & Repeat the above trigger for each Data Entry field in column 1
  • Add a button for column 1 and add the below trigger to that button
  • PASS: Adjust Variable [TotalCol1] +Add (the value of) [1A] when the user clicks [button]
  • Rinse & Repeat the above trigger for each variable in column 1 and add to the button

That should do it!

This discussion is closed. You can start a new discussion or contact Articulate Support.