Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
michael_andrews
Partner - Creator
Partner - Creator

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
Ans11010 / 15
Ans244 / 15
Ans311 / 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.

1 Solution

Accepted Solutions
sunny_talwar

What is your expression for Time Selected? loveisfail‌ 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.

View solution in original post

6 Replies
MK9885
Master II
Master II

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

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

OmarBenSalem

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

Anil_Babu_Samineni

Perhaps this?

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


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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

What is your expression for Time Selected? loveisfail‌ 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.

michael_andrews
Partner - Creator
Partner - Creator
Author

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

sunny_talwar

Whatever you are using to generate # of responses

Capture.PNG