Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Devendra_Babar
Partner - Contributor II
Partner - Contributor II

Top N chart is showing N-1 value

Hello Everyone,

 

I am trying to create Top N chart with two dimensions and one measure.

My dimensions and Measure are as follow's:

  • Dimension1: aggr(if(rank(sum(Sales))<=vTopRank,Customer),Customer)
  • Dimension2: [Invoice Date]
  • Measure : sum(Sales)
  • vTopRank is variable

I'm trying to vary vTopRank using slider, but whenever I try to do so. I'm getting result by Top N-1.

To elaborate this. If I want Top 10 records it show's me Top 9 records.

Is there anything I am doing wrong with my Dimension1 or somewhere else?

Please let me know if you have any clue on this.

Thanks in Advance.

Labels (3)
1 Solution

Accepted Solutions
Devendra_Babar
Partner - Contributor II
Partner - Contributor II
Author

Hello Everyone,

I tried almost every possible solution available on community to solve this issue by creating different different calculation dimension and measure.

But unfortunately I didn't get anything which can solve this issue.

So I tweaked my first dimension in such a way that it will solve this issue automatically.

Here is my calculated dimension.

"IF(MATCH($(=COUNT(IF(AGGR(Rank(sum(Sales))<=vTopRank,Customer),Customer))),vTopRank),
IF(AGGR(Rank(sum(Sales))<=vTopRank,Customer),Customer),
IF(AGGR(Rank(sum(Sales))<=vTopRank
- $(=COUNT(IF(AGGR(Rank(sum(Sales))<=vTopRank,Customer),Customer))-vTopRank),
Customer),Customer)
)"

Basically here I am doing plus or minus according to given result by old calculated dimension.

This solved my issue but I am still confused about, why old calculated dimension was not giving correct answer?

Please do let me know if you ever faced such situation and found cause of it.

 

--

Regards,

Devendra Babar

View solution in original post

3 Replies
bramkn
Partner - Specialist
Partner - Specialist

turn of the other values?
Devendra_Babar
Partner - Contributor II
Partner - Contributor II
Author

Thanks for Reply.
But I have already unchecked "Show Others" option from both Dimensions.

--
Thanks,
Devendra Babar
Devendra_Babar
Partner - Contributor II
Partner - Contributor II
Author

Hello Everyone,

I tried almost every possible solution available on community to solve this issue by creating different different calculation dimension and measure.

But unfortunately I didn't get anything which can solve this issue.

So I tweaked my first dimension in such a way that it will solve this issue automatically.

Here is my calculated dimension.

"IF(MATCH($(=COUNT(IF(AGGR(Rank(sum(Sales))<=vTopRank,Customer),Customer))),vTopRank),
IF(AGGR(Rank(sum(Sales))<=vTopRank,Customer),Customer),
IF(AGGR(Rank(sum(Sales))<=vTopRank
- $(=COUNT(IF(AGGR(Rank(sum(Sales))<=vTopRank,Customer),Customer))-vTopRank),
Customer),Customer)
)"

Basically here I am doing plus or minus according to given result by old calculated dimension.

This solved my issue but I am still confused about, why old calculated dimension was not giving correct answer?

Please do let me know if you ever faced such situation and found cause of it.

 

--

Regards,

Devendra Babar