Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
kamal_sanguri
Specialist
Specialist

Problem with set analysis

I am not able to figure out the problem with this Set Expression:

=count({<Author_Name = {"=rank(count({<Word_Count = {'>250'}>}Stories))<=5"}>}Stories)

I have written it to count the number of stories where Word_Count is over 250 with top 5 authors... This expression returns the number but not correct.. it is ignoring condition to check word_count > 250. Even if I change 250 to 100 there is no difference.

1 Solution

Accepted Solutions
Digvijay_Singh

If there are multiple aggregation functions like count/sum in an expression. The set expression is needed to be written for all.

If you feel it solved your issue, you may like to close this thread.

View solution in original post

21 Replies
vishsaggi
Champion III
Champion III

Can you try this and check?

=count({<Author_Name = {"=rank(count(IF(Word_Count > 250, Stories)) <=5"}>} Stories)

kamal_sanguri
Specialist
Specialist
Author

Thanks for checking this..

yes after adding missing ")" it is working

=count({<Author_Name = {"=rank(count(IF(Word_Count > 250, Stories))) <5"}>} Stories)


I understand that I can use IF instead but I am more curious to know where is the problem with my expression?

vishsaggi
Champion III
Champion III

What values does your Word_Count holds? Can you share a sample to look into?

kamal_sanguri
Specialist
Specialist
Author

! !

sunny_talwar

I think the two expressions are slightly different... one is < 5 and other is <= 5...If I change set analysis to < 5.. it gives 78352 also

=Count({<Author_Name = {"=rank(count({<Word_Count = {[>250]}>}Stories))<5"}>}Stories)

vishsaggi
Champion III
Champion III

Try this expr: you were using <= 5 rather than < 5 so just removed =.

=count({<Author_Name = {"=rank(count({<Word_Count = {'>250'} >}Stories))< 5 "}>} Stories)

vishsaggi
Champion III
Champion III

Thanks for reminding. Its been quite a while I used [] brackets inside set.

sunny_talwar

This is my first time

sunny_talwar

Never had to use it before, but with the introduction of stricter quoteology, we might have to use it more often