6 Replies Latest reply: Oct 20, 2017 1:03 PM by Sunny Talwar

# Get total count of responses to a question for each response

So I have data that is essentially a test. A test has questions, and each question may have multiple responses. I need to do a calculation on the response level, but also work with the total number of responses for that question. Let's assume my data looks like so

Question 1 had 15 total responses

 Response Name # of responses % correct Ans1 10 10 / 15 Ans2 4 4 / 15 Ans3 1 1 / 15

Basically what I need to do is figure out a way in the function for % correct to get that 15 number each time to work with. Any idea on how I do that. I've attached a screen shot of my actual data to help portray what I'm trying to do.

• ###### Re: Get total count of responses to a question for each response

You might need to do TOTAL for your Time Selected expression....

Can you tell us what expression are you using for 'Time Selected'?

• ###### Re: Get total count of responses to a question for each response

It would be sum(YourMeasure)  /sum (total {<yourDimension>} YourMeasure)

• ###### Re: Get total count of responses to a question for each response

Perhaps this?

Sum([Time Selected]) / Sum(TOTAL [Time Selected])

Note - TOTAL Keyword fetch and shows the Total value for measure.

• ###### Re: Get total count of responses to a question for each response

What is your expression for Time Selected? Anil have pointed you in the right direction, but if you expression is more complicated then just Sum([Time Selected]), you might need to use Sum(TOTAL (Aggr(YourExpression, ItemName, ItemResponse)) to get the total across all the rows.

• ###### Re: Get total count of responses to a question for each response

What do you mean in that last line by YourExpression? What should that represent? Thanks,

• ###### Re: Get total count of responses to a question for each response

Whatever you are using to generate # of responses