Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

new requirements for Creating Report for top 2 answers given by category by country

Good day

I had previously asked this question and it got answered but now I have new requirement which i can't figure out.

The original question can be found here

Creating Report for top 2 answers given by category by country

I had to modify the original Answers given by Andrew:

=Aggr(if(Rank(Count({<Questions={'Question1'},Answers-={''}>} Answers),1,1)=1,Answers),Category,Country,Answers)

=Aggr(if(Rank(Count({<Questions={'Question1'},Answers-={''}>} Answers),1,1)=1,Count({<Questions={'Question1'}>} Answers)),Category, Country,Answers)/Count({<Questions={'Question1'},Answers-={''}>} Answers)

since some answers for question1 where left blank(in my data) i added the part {<Questions={'Question1'},Answers-={''}>} since i don't want blank answers taken into conisderation.

I have an additional requeirement:

Each survey (in addition to Question1) has Question2 where possible answers are 1,2,3,4,5.

We want to keep the same logic as above but only for surveys that have Question2 answered 4 and below(exclude answer 5).

Tried this for the count: P({<Questions={'Question2'}, Answers-={'5'}>}) * P({<Questions={'Question1'}, Answers-={''}>})

But for some reason i could not get it right

Any help is greatly appreciated

thank you so much

2 Replies
sunny_talwar

P({<Questions={'Question2'}, Answers-={'5'}>}) * P({<Questions={'Question1'}, Answers-={''}>})

What is the exact expression you tried? This only is the set analysis part of the expression, right?

Anonymous
Not applicable
Author

Correct

I need to replace in:

=Aggr(if(Rank(Count({<Questions={'Question1'},Answers-={''}>} Answers),1,1)=1,Answers),Category,Country,Answers)


with


P({<Questions={'Question2'}, Answers-={'5'}>}) * P({<Questions={'Question1'}, Answers-={''}>})


but when i replace it it returns no value.

should it be some field = P({<Questions={'Question2'}, Answers-={'5'}>}) * P({<Questions={'Question1'}, Answers-={''}>})


thank you