Storing Reference Data Base for Calculations | XM Community
Skip to main content
Solved

Storing Reference Data Base for Calculations

  • September 30, 2019
  • 4 replies
  • 6 views

Forum|alt.badge.img+19
  • Level 5 ●●●●●
  • 543 replies
My senario is this: I want individuals to enter their origin: "Zip Code A". From there, I would qualtrics to be able to reference a database of Zipcodes to determine how far "Zip Code A" is from my location, "Zip Code B". I can easily make a list of possible Zip Codes A and their distance from me in a spreadsheet. But how do I get Quatlrics to reference that and spit out a distance for me to use in embedded data calculations? We're working on a LEEDs survey to measure the C02 Emissions incurred by respondents as they travel to our building. I need to take this distance and be able to multiply it by the number of trips the respondent takes in a week, multiplied by the C02 Emissions incurred by each method of transportation. Without Qualtrics doing half this work for me, I'm in for a really long analysis. But it definitely feels like something I should be able to use math operations for pretty easily if I can solve this "distance" problem.

Best answer by JenCX

I thought I remembered something @TomG had said about a similar ask So to quote our great guru (or Wizard, I should say), it should be possible to do this if you store the zipcodes in an external web database, then use an ajax call to check for the corresponding distance. I don't know how to do any of that but I suppose it's a place to start?

4 replies

JenCX
Level 5 ●●●●●
Forum|alt.badge.img+11
  • Level 5 ●●●●●
  • 683 replies
  • Answer
  • September 30, 2019
I thought I remembered something @TomG had said about a similar ask So to quote our great guru (or Wizard, I should say), it should be possible to do this if you store the zipcodes in an external web database, then use an ajax call to check for the corresponding distance. I don't know how to do any of that but I suppose it's a place to start?

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6083 replies
  • September 30, 2019
> @JenCX said: > I thought I remembered something @TomG had said about a similar ask > > So to quote our great guru (or Wizard, I should say), it should be possible to do this if you store the zipcodes in an external web database, then use an ajax call to check for the corresponding distance. I don't know how to do any of that but I suppose it's a place to start? @Kate, Probably the easiest solution is a web service call from the survey flow to a script that does a database lookup (and distance calculation). Ajax adds additional complexity that you only need if it has to be interactive (i.e., on the same page). From your description, it doesn't sound like you need that.

Forum|alt.badge.img+19
  • Author
  • Level 5 ●●●●●
  • 543 replies
  • October 1, 2019
@TomG This is pretty new to me- do you have any suggestions on some learning materials to start to get aquainted with web service calls?

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6083 replies
  • October 1, 2019
Kate, Making a web service call is fairly straightforward: https://www.qualtrics.com/support/survey-platform/survey-module/survey-flow/advanced-elements/web-service/#AddingAWebService The move involved part is creating the server side script and database. Here is a link to a message I posted that provides the basic flow of a web service script: https://stackoverflow.com/a/43481680/4434072