Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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

Don't see anything wrong here....

Anil_Babu_Samineni

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])

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
sunny_talwar

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

Anil_Babu_Samineni

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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
sunny_talwar

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

True

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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

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 (- - - -).