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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
samp
Contributor III
Contributor III

Set Analysis with rank and filter

I am trying to add filter along with rank as below seems syntax is correct but I am not getting expected results any help?


Count({<[Investment Strategy] = {"=Rank(Count({<Type = {'RFI','Database Search','Database Search Follow-Up'},Quarter={'Q1','Q2','Q3'},Year={""$(=Max(Year))""}>} [Investment Strategy]))<11" } > } [Investment Strategy])

15 Replies
sunny_talwar
MVP
MVP

Don't see anything wrong here....

Anil_Babu_Samineni
MVP
MVP

When you say values are not getting as expected. You may provide more detail the business. For a while, Remove one extra double quote and check?

sam pusala wrote:

I am trying to add filter along with rank as below seems syntax is correct but I am not getting expected results any help?


Count({<[Investment Strategy] = {"=Rank(Count({<Type = {'RFI','Database Search','Database Search Follow-Up'},Quarter={'Q1','Q2','Q3'},Year={""$(=Max(Year))""}>} [Investment Strategy]))<11" } > } [Investment Strategy])

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
MVP
MVP

Those double quotes are important loveisfail‌... they are used as Escape sequences

Anil_Babu_Samineni
MVP
MVP

Accept with you, But, Max(Year) always return one only only. Not sure how escape engage here?

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
MVP
MVP

I see what you are saying, in that case... I would remove both the double quotes

Count({<[Investment Strategy] = {"=Rank(Count({<Type = {'RFI','Database Search','Database Search Follow-Up'},Quarter={'Q1','Q2','Q3'},Year={$(=Max(Year))}>} [Investment Strategy]))<11" } > } [Investment Strategy])

Anil_Babu_Samineni
MVP
MVP

True

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
samp
Contributor III
Contributor III
Author

Hi Sunny/Anil,

Here I am comparing below 2set analysis with only filter and with filter and rank

1) with only filter (results are correct)

Count({<Type = {'RFI','Database Search','Database Search Follow-Up'},Quarter={'Q1','Q2','Q3'},Year={"$(=Max(Year))"}>}[Investment Strategy])

(selecting manually fixed number and top 10, using qlik sense)

2) with filter and rank

Count({<[Investment Strategy] = {"=Rank(Count({<Type = {'RFI','Database Search','Database Search Follow-Up'},Quarter={'Q1','Q2','Q3'},Year={""$(=Max(Year))""}>} [Investment Strategy]))<11" } > } [Investment Strategy])

(I assume that filters are not applying automatically, if I select same filters manually, result looks fine )

The 2) result is same as with simple count function except rank Count([Investment Strategy])

Not returning anything If I remove one double quote

sunny_talwar
MVP
MVP

What do you see when you create a chart with

Dimension

Investment Strategy

Expression

=Rank(Count({<Type = {'RFI','Database Search','Database Search Follow-Up'},Quarter={'Q1','Q2','Q3'},Year={""$(=Max(Year))""}>} [Investment Strategy]))<11

samp
Contributor III
Contributor III
Author

returning all dashes (- - - -).