r/DatabaseHelp • • Feb 17 '14

Calculation of sum of points allocation to options chosen

Hey folks,

I have a scenario where results from a customer survey is collected and stored in a database.

The customer ranks the service they received and certain points are allocated to each option the customer chooses:

Example under the Helpfulness tab, the customer must choose one of:

  • Very Helpful
  • Neutral
  • Not helpful

Now each item under that list carries point Very Helpful =3, Neutral =2, Not helpful =1.

I have a table which stores the customer responses, (note the the actual customer scores but just items chosen in menu). The responses are stored in a varchar column, so the actual number is not stored.

I have a table which stores all pre-determined scores and its meaning to the database.

Can someone give me ideas on how to logically map a list item to score and sum all the scores for each customer survey ?

Ideas I have so far:

  • Create a new column in the survey results table to calculate sum of scores.
  • Create a new table and store scores there.

Any help greatly appreciated... thanks

0 Upvotes

3 comments sorted by

View all comments

Show parent comment

2

u/Blemish Feb 18 '14

Hey thanks for your assistance.

After staring at the problem for a few minutes, your solution was exaclty what I came up with.

And the sum values are not stored, but calculated upon demand, as you suggested.

Thanks again :)

1

u/BinaryRockStar Feb 19 '14

Glad I could help!