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

How to calculate and prefill Quantity Ordered and Total Cost


Forum|alt.badge.img+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.

Best answer by MohammedAli_Rajapkar

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.
View original

10 replies

Forum|alt.badge.img+3
  • Author
  • 12 replies
  • July 10, 2018
I will add that I have very very little java script experience

Samarth
Level 2 ●●
Forum|alt.badge.img+5
  • Level 2 ●●
  • 54 replies
  • July 13, 2018
Hi @Sludemann,

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

Regards,
Samarth

Forum|alt.badge.img+3
  • Author
  • 12 replies
  • July 13, 2018
Here is the file. Thank you so much.

Forum|alt.badge.img+3
  • Author
  • 12 replies
  • July 13, 2018
Here is the 2nd survey. I would assume the code will be applicable to apply to both scenarios.

Forum|alt.badge.img+3
  • Author
  • 12 replies
  • July 18, 2018
> @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.

Samarth
Level 2 ●●
Forum|alt.badge.img+5
  • Level 2 ●●
  • 54 replies
  • July 20, 2018
Hi @Sludemann ,

Allow me some time I will revert back to you!

Regards,
Samarth

Forum|alt.badge.img+3
  • Author
  • 12 replies
  • July 20, 2018
Thank you so much. We really want to kick this off early next week.

LaurenK
Former XM Community Team Member
Forum|alt.badge.img+13
  • Former XM Community Team Member
  • 900 replies
  • August 10, 2018
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. 🙂

MohammedAli_Rajapkar
QPN Level 5 ●●●●●
Forum|alt.badge.img+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.

Forum|alt.badge.img
  • 1 reply
  • July 20, 2023

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!