Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

sampusala
New Contributor II

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

Tags (1)
15 Replies
MVP
MVP

Re: Set Analysis with rank and filter

Don't see anything wrong here....

Re: Set Analysis with rank and filter

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

MVP
MVP

Re: Set Analysis with rank and filter

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

Re: Set Analysis with rank and filter

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

MVP
MVP

Re: Set Analysis with rank and filter

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

Re: Set Analysis with rank and filter

True

sampusala
New Contributor II

Re: Set Analysis with rank and filter

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

MVP
MVP

Re: Set Analysis with rank and filter

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

sampusala
New Contributor II

Re: Set Analysis with rank and filter

returning all dashes (- - - -).