Subtotal for question groups | Community
Skip to main content
Answered

Subtotal for question groups


Forum|alt.badge.img+1

I am trying to create an assessment. I have 6 sections and I need a subtotal divided by the number of questions in each section.

I need to have that score in my results.

Is this possible? I’ve tried adding logic to add each question to the next but it’s not working.

Can someone help me?
 

Best answer by john.desborough

@kmkdeal - create the variables as follows: 

  • v_sec1 Number 0 (default value)
  • v_sec2 Number 0 (default value) 

then you can add a number to a numeric variable.. 

 

des

View original

18 replies

john.desborough
Forum|alt.badge.img+6
  • Certified Partner & Champion
  • 5312 replies
  • May 12, 2024

@kmkdeal - create a custom variable for each section to act as a subtotal. ie v_sec1, v_sec2 etc

 

then in your logic you do the following 

  • add the points for each question to the appropriate variable
    • if q1 = A add 1 to v_sec1
    • if q1 = B add 2 to v_sec1
  • at the end of each section you will have a running total for the variable based on the answers. then  you need to divide the variable by the number of questions in the section
    • divide v_sec1 by X (where X is the number of questions.)

that will result in the ‘running total’ now becoming the average value that you describe.

hope that helps

 

des


Forum|alt.badge.img+1
  • Author
  • Explorer
  • 11 replies
  • May 13, 2024

I am so confused. I am trying to do this with just a few questions to get it working.

I think I added the variables and the scores for each answer. Does the logic for the scoring go in Branching and Calculations? Help?

 

 


john.desborough
Forum|alt.badge.img+6
  • Certified Partner & Champion
  • 5312 replies
  • May 13, 2024

@kmkdeal don’t use the @score variable

you need to use the answer to the question ie from your image

  • if q1 is ‘something’ (if multiple choice, then A for example) then add 1 to v_sec1

Forum|alt.badge.img+1
  • Author
  • Explorer
  • 11 replies
  • May 13, 2024

Here is the scoring:

 

Is this correct:

 

I can’t access the “to” as it’s greyed out and I can’t click in it.


john.desborough
Forum|alt.badge.img+6
  • Certified Partner & Champion
  • 5312 replies
  • May 13, 2024

@kmkdeal - have you created variables for each subsection using the Logic / Personalize with data selection? you should have done it in a screen that looks similar to this: 

 


Forum|alt.badge.img+1
  • Author
  • Explorer
  • 11 replies
  • May 13, 2024

 


john.desborough
Forum|alt.badge.img+6
  • Certified Partner & Champion
  • 5312 replies
  • Answer
  • May 13, 2024

@kmkdeal - create the variables as follows: 

  • v_sec1 Number 0 (default value)
  • v_sec2 Number 0 (default value) 

then you can add a number to a numeric variable.. 

 

des


Forum|alt.badge.img+1
  • Author
  • Explorer
  • 11 replies
  • May 13, 2024

Is this correct or do I have to enter the number for each of the five options?

 

 


Forum|alt.badge.img+1
  • Author
  • Explorer
  • 11 replies
  • May 13, 2024

I think I figured it out. Now I just need to do the average. I added a rule to divide by a number. Hope it works.


Is it possible to have a URL redirect based on the v_sec totals? 
Ideally I would have two ending pages - one would look at the v_sec totals and thank them and redirect while the other would just say thank you.

Thank you again!!


Forum|alt.badge.img+1
  • Author
  • Explorer
  • 11 replies
  • May 14, 2024

@john.desborough Is it possible to have a URL redirect based on the v_sec totals? 

Ideally I would have two ending pages - one would look at the v_sec totals and thank them and redirect while the other would just say thank you.


john.desborough
Forum|alt.badge.img+6
  • Certified Partner & Champion
  • 5312 replies
  • May 14, 2024

@kmkdeal you would need to create two (or more) redirect endings - each pointing to the correct downstream location. 

then you would use logic rules to send the user to the appropriate ending/redirect

 

des


Forum|alt.badge.img+1
  • Author
  • Explorer
  • 11 replies
  • May 14, 2024

Can I do one ending that is static text. 
A separate ending that is text that forwards to a URL?

I haven’t figured out how to do the logic based on different v_sec values.

As always thank you for all of your help. 😁


john.desborough
Forum|alt.badge.img+6
  • Certified Partner & Champion
  • 5312 replies
  • May 14, 2024

yes,, use ending A for your static ending  - you can also have a button that has a link behind to send someone to your website for example.

 

as for the v_sec rules - write them out on paper or in a text file.. sort of like this: if v_sec1 is greater than 5 and v_sec2 is greater than 5 and all the others are less than 5 go to thank you ending

if v_sec 2 and v_sec 5 are greater than 10 go to ending B (redirect to www dot somewhere) 

 

then we can help you set up the basic logic rules in typeform

 

cheers

 

des


Forum|alt.badge.img+1
  • Author
  • Explorer
  • 11 replies
  • May 15, 2024

Perfect.  Do I use the endings as they exist or something different?

The logic is 
If v_sec1 > 3, and v_sec2 > 3, and v_sec3 > 3, then go to a scheduling link.

Otherwise, go to the static ending page.


Forum|alt.badge.img+1
  • Author
  • Explorer
  • 11 replies
  • May 16, 2024

I think I am making progress. Will test and keep you posted.


Forum|alt.badge.img+1
  • Author
  • Explorer
  • 11 replies
  • May 23, 2024

I think I was able to kind of do this just using the follow up option.


Forum|alt.badge.img+1
  • Author
  • Explorer
  • 11 replies
  • May 23, 2024

@john.desborough 

Is it possible to compare all of the variables and put them in order from highest to lowest in an email?

I use the values and each letter correlates to a letter.

This is what it looks like in my spreadsheet. I’d like to not have to look at each on but rather program it to do the work for me.

 

v_sec1 v_sec2 v_sec3 v_sec4 v_sec5 v_sec6  
G T E D W I  
6.56 8.5 8.17 5.57 6.86 8.57 IT ED WG
8.33 8.17 9 6.57 8.14 8 EG TW ID

john.desborough
Forum|alt.badge.img+6
  • Certified Partner & Champion
  • 5312 replies
  • May 23, 2024

@kmkdeal - the issue here is that the spreadsheet does not have the ability to sort ascending/descending across a row… it can only do it on a column.. 

so you would have to do a transform() function to convert the cells from the row into a column, sort them in the order you want and then transform() them back to single row and write it into another series of columns…. and do that automatically whenever a row is added to the sheet. 

not something that i have cracked in Google Sheets yet and not something i am planning on trying to invest more time into solving on a personal level. 

 

des


Reply