[Solved] Creating calculations

0

I have 3 questions: employees dedicated (radio button  -3 options ), monthly quota (radio button- 3 options), and commission (radio button – 3 options) and need to create a calculation that is essentially

employees dedicated*monthly quota*commission. Does anyone know how i would go about this? I understand that i can use custom scripting but i was wondering if there were any examples i could use? 

Thanks

Anna 

Anna Mattha asked

    Best answer

    0
    qc 558 Rep.

    Simple version:

    %%employees_qid = 1;    // Question ID for “Employees Dedicated”

    %%quota_qid = 2;         // Question ID for “Monthly Quota”

    %%commission_qid = 3;    // Question ID for “Commission”

    %%payout_qid = 4;          // Question ID for the Hidden Value or Question where you want to store the calculated value

     

    %%payout = sgapiGetValue(%%employees_qid) * sgapiGetValue(%%quota_qid) * sgapiGetValue(%%commission_qid);

    sgapiSetValue(%%payout_qid, %%payout);

     

    On the above, I’m assuming that either the radio button options are actual numbers, or you’ve assigned each option a numeric reporting value. Either way, make sure you omit any characters that aren’t numbers or a period (e.g. the value for commission should omit dollar sign and commas).

    qc answered
      • Thank you very much. Yes, each question has a numeric value and i will remove any dollar signs or commas in the reporting value. Thanks again for your response.

      • I’m not sure how to set this up. I’ve tried to set it up and i can’t seem to get it to work. Is there a resource that can provide step by step directions?

      0
      qc 558 Rep.

      Here’s a quick screenshot of how your survey could look:

      And here’s how the Custom Script Action would look:

      Use the “Question & Page ID Lookup” dropdown to find the correct question IDs to drop into the custom script.

      If you need specific instructions for how to add Custom Scripting to your survey, then I suggest checking out SurveyGizmo’s help articles, or reaching out to them directly for help.

       

      qc answered
        ×

        Login

        Question stats

        • Active
        • Views2185 times
        • Answers2 answers
        • Followers0 followers