Forum Discussion

ShannonPage-27d's avatar
ShannonPage-27d
Community Member
2 years ago

Basic Calculations with variables troubleshooting. Assistance requested :)

Hi there! I hope this type of post is allowed. I was given a spreadsheet that I need to turn into a Storyline calculator for Earned Value. I was trying to use the helpful post from Mike Enders here. I finally have decided that I am completely in over my head. I am unable to make the calculations appear after inputing the numbers. I added my notes to the outside of the storyboard so that anyone who great at calculators or numbers might can help if they have any inclination :)

Essentially, I want to input the values Planned Value, Earned Value and Actual Cost and from there the user should be able to click Calculate and show the answer under the relevant section. There are four calculations to show. After that, I would like to make it where they can't CONTINUE to click calculate so that the numbers maintain their integrity. Additionally, my clear button would clear the calculator. 

I would be so extremely grateful if anyone would like to take a look. I added the variables that I think I need in the attached file, but then ground to a halt :/

Full disclosure, I cried my way through math in college.

  • A variable is used to store a value (for example: True or False; a text entry; or a numeric entry). The program "remembers" the value throughout the course. It won't change until a trigger runs that adjusts the value. 

    When you insert a data-entry field, Storyline (SL) automatically creates a variable to hold its value.

    • SL gives the variables generic names. It will be quite helpful for your programming and for troubleshooting if you take the time to give all variables (as well as all objects) meaningful names.

    Numeric-entry fields have numeric variables, which means the variable will only accept a number. That also means the program can perform calculations using the value. 

    In your case, you want the PV, EV and AC variables to maintain whatever value the user inputs. In other words, you don't want to perform calculations on those variables. Instead, you want to perform calculations with those variables.

    Here's an example. The  Variable Schedule = Earned Value - Planned Value. You need multiple triggers to do this. The first trigger sets the starting value. The subsequent trigger performs the calculations. They would look like this: 

    As you can see, you'll need a set of triggers to perform each of the 4 calculations you want to show. 

    The four calculated values/variables won't change until the calculation triggers run again (i.e., the user re-clicks the Calculate button). 

    The Clear button would need triggers to set the value of all of the variables to 0. 

    There are various ways to prevent the user from making changes. For example, cover the entry fields with a semi-transparent shape and disable the Calculate button when the user clicks the Calculate button. Then hide those shapes and enable the button when the user clicks Clear. 

    For troubleshooting:

    • As I said, giving everything a meaningful name will help. 
    • Be sure each trigger refers to the appropriate variable(s). 
    • Be sure the triggers are in the proper order. (They run in order.)

    Here's more info about variables: https://community.articulate.com/series/articulate-storyline-360/articles/articulate-storyline-360-user-guide-how-to-work-with-variables