Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot table help

I have a pivot table pulling data from my dataset, which contains a number of questions, several possible answers to each question (satisfied, need to learn....etc), several report periods, and a unique userID for each person that answered the questions.

I have a pivot table that works, but only if I select at least 1 question from the list of questions.  Here is my current expression (given to me as a starting point):

count(RespondentID) / aggr(nodistinct count(distinct RespondentID), Question, ReportPeriod)

and I have it formatted as a number (##.##%).

My dimensions are:  Answer and ReportPeriod

What I'm seeing, is that if I don't have any of the questions selected, my percentage for Satisfied is 1274.89%, another is 145.44%....etc.

As soon as I select a question though, the percentages correct themselves.

Thanks in advance for any and all help!

Tim

7 Replies
jolivares
Specialist
Specialist

I already make one report like for human resources.  It's possible that you need to aggregate your data in order your percentages show the correct numbers.

Try to post some sample date to if I can help you.

Anonymous
Not applicable
Author

Hi Timothy,

Without looking into the data here my first guess is that the denominator in your expression is getting calculated with a much lesser value. It would be worth to check if this is due to distinct (as there is no distinct in numerator )? Secondly try using total <> qualifier . Eg:
count(total <Question> RespondentID) / aggr(nodistinct count(RespondentID), Question, ReportPeriod)

Regards

Nakul

ramasaisaksoft

Hi Timothy,

we were not understanding ur question properly so,

it is possible to give solution  when u share some sample data.

and let us know what is result u want exactly?

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Share some sample data to get quick solution.

Regards,

Nagarjna

Not applicable
Author

Sorry everybody, just trying to get sample data uploaded.  I'm hoping that a .csv file will be okay???  I'm not sure how I attach a file though....

jonathandienst
Partner - Champion III
Partner - Champion III

It may be as simple as adding the other pivot dimension to your aggr dimensions:

=count(RespondentID) / aggr(nodistinct count(distinct RespondentID), Question, ReportPeriod, Answer)


As a rule, you need all the chart dimensions (as a minimum) in your Aggr().

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

AnswerQuestionRegionReportPeriodRespondentIDSBU
SatisfiedInternetAsia10/1/20141SBU1
Need to learnInternetUS10/1/20142SBU2
About the sameInternetUS5/1/20142SBU2
SatisfiedHomepageAsia10/1/20141SBU1
Doesnt meet needsHomepageEurope10/1/20143SBU3
SatisfiedMobileAsia10/1/20144SBU4
SatisfiedMobileAsia10/1/20145SBU3
Doesnt meet needsStorageEurope10/1/20143SBU3
Need to learnStorageUS10/1/20142SBU2
SatisfiedStorageAsia10/1/20145SBU3
Need to learnStorageAsia5/1/20141SBU1
Doesnt meet needsStorageEurope10/1/20136SBU3
SatisfiedStorageAsia10/1/20137SBU1
About the sameStorageUS5/1/20148SBU4
Need to learnStorageEurope5/1/20149SBU1

Sorry, I couldn't find how to attach a CSV, but this is a sample of what I'm dealing with.

Thanks,

Tim