How to calculate and prefill Quantity Ordered and Total Cost | XM Community
Solved

How to calculate and prefill Quantity Ordered and Total Cost


Userlevel 1
Badge +3
!

I am wondering if there is java script code that would prefill the quantity ordered from the order detail question - a tabulation of the quantity ordered from the size section would need to be carried down to the size and pricing question. is there then a formula that could be used then to calculate the total cost based on the pricing of each size ordered. See attached.
icon

Best answer by MohammedAli_Rajapkar 26 August 2018, 20:31

View original

10 replies

Userlevel 1
Badge +3
I will add that I have very very little java script experience
Userlevel 4
Badge +5
Hi @Sludemann,

Can you share the QSF and I can share the code.

Regards,
Samarth
Userlevel 1
Badge +3
Here is the file. Thank you so much.
Userlevel 1
Badge +3
Here is the 2nd survey. I would assume the code will be applicable to apply to both scenarios.
Userlevel 1
Badge +3
> @Samarth said:
> Hi @Sludemann,
>
> Can you share the QSF and I can share the code.
>
> Regards,
> Samarth

Did I provide you with what you needed? Thanks again for any assistance you can provide.
Userlevel 4
Badge +5
Hi @Sludemann ,

Allow me some time I will revert back to you!

Regards,
Samarth
Userlevel 1
Badge +3
Thank you so much. We really want to kick this off early next week.
Userlevel 7
Badge +13
Hey @Sludemann! Although I do recognize you are asking for a custom code solution, you'll be able to accomplish something similar through the use of Math Operations and the Survey Flow. I would recommend reaching out to our Support team who can work with you to get this setup. 🙂
Userlevel 7
Badge +20
To make this setup more user-friendly we will have to change the second question and it should look like as shown in the screen-shot.
Also, to make this setup a little bit easy, the user will have to select the gender first and then enter the size info.

!

Apart from '" Total cost" calculation, the rest looks fine... you can take a look... below is the link

https://qimpl.az1.qualtrics.com/jfe/preview/SV_3F1UKb12nr3ZwHz?Q_SurveyVersionID=current&Q_CHL=preview

I can share the QSF with you... if you are still working on this setup.
Badge

Hi there, I am very interested to find out abou the codes behind this question format. I am looking to run a merchandise sales for my school and would like to learn how to calculate total costs too. Could you tell me more / share with me how it is done? Thanks a lot!

Leave a Reply