Calculate Variables help (use action group?)
June 18, 2009 12:00 AM
I need some help to handle a simple problem simply. I am currently handling it in a difficult way and I'm thinking that I could probably run an action group to make this simpler.
Task: Show the user how much $ they will put into their 401K if they set aside 1%, 2%, 3%, or 4% of their earnings, and need to show the weekly $ and the monthly $ put aside. I have 2 drop down lists: one with Hourly Wage and one with Hours Worked Per Week. Once they make their selections, they click a Calculate button. When they click Calculate, I want the % fields to be filled with data. I've got it working with 1% but I'm using 8 actions to do it, and if I expand this for all 4 selections that's going to be one mega button.
Current approach:
Action1: On click, modify variable: _WkSalary, value: VAR(_HrlyWage), set variable contents.
Action2: On click, modify variable: _WkSalary, value: VAR(_HrsWrkd), multiply variable by.
Action3: On click, modify variable: _OneWeek, value: VAR(_HrSalary), add to variable.
Action4: On click, modify variable: _OneWeek, value: 0.01, multiply variable by.
Action5: On click, modify variable: _OneYear, value: VAR(_OneWeek), set variable contents.
Action6: On click, modify variable: _OneYear, value: 52, multiply variable by.
Action7: On click, change contents: 1%Weekly, New Contents: _OneWeek.
Action8: On click, change contents: 1%Yearly, New Contents: _OneYear.
Please tell me there's a simpler way to get this to work. Thanks in advance.I need some help to handle a simple problem simply. I am currently handling it in a difficult way and I'm thinking that I could probably run an action group to make this simpler.
Task: Show the user how much $ they will put into their 401K if they set aside 1%, 2%, 3%, or 4% of their earnings, and need to show the weekly $ and the monthly $ put aside. I have 2 drop down lists: one with Hourly Wage and one with Hours Worked Per Week. Once they make their selections, they click a Calculate button. When they click Calculate, I want the % fields to be filled with data. I've got it working with 1% but I'm using 8 actions to do it, and if I expand this for all 4 selections that's going to be one mega button.
Current approach:
Action1: On click, modify variable: _WkSalary, value: VAR(_HrlyWage), set variable contents.
Action2: On click, modify variable: _WkSalary, value: VAR(_HrsWrkd), multiply variable by.
Action3: On click, modify variable: _OneWeek, value: VAR(_HrSalary), add to variable.
Action4: On click, modify variable: _OneWeek, value: 0.01, multiply variable by.
Action5: On click, modify variable: _OneYear, value: VAR(_OneWeek), set variable contents.
Action6: On click, modify variable: _OneYear, value: 52, multiply variable by.
Action7: On click, change contents: 1%Weekly, New Contents: _OneWeek.
Action8: On click, change contents: 1%Yearly, New Contents: _OneYear.
Please tell me there's a simpler way to get this to work. Thanks in advance.
Discussions have been disabled for this post