How to sort a top N when using calculated dimension?

rated by 0 users
Not Answered This post has 0 verified answers | 7 Replies | 2 Followers

Top 500 Contributor
Points 153
cchicaud posted on Mon, Feb 8 2010 10:33 AM

Hi,

I need to display the top N products by years in a bar chart and group the remaining products as 'other products'.

In order to do that, i'm using aggr() function in calculated dimension:

 =aggr(if(rank(sum(Sales))<5, Product,'Other products'),Product) 

This is working properly but the issue is that i'm not able to sort those products. I tried different formulas as sorting expression in the chart without any success...

Any idea on how to perform a sort here? (see the qvw attached)

Thanks in advance.

  • | Post Points: 13

All Replies

Top 50 Contributor
Points 925

HI

Please find the attachements.

I think it ll helpful for u.

 

Regards

Sathish

  • | Post Points: 7
Not Ranked
Points 91

I used the same approach for one of my tables.  Is there a way to have the 'Others' bucket always display after the top N are sorted and displayed?  This is the issue I am facing now.

  • | Post Points: 1
Top 500 Contributor
Points 153

Hi,

It's easy to sort by Y-value when only one dimension is used. But my problem is more with the bar chart where "Year" is the first dimension and the aggr() dimension the second one.

In this case, the second dimension can be sorted using a specific "expression" but i'm not able to find the right formula. Whatever the expression i use, it has no effect on the product sorting in the bar chart.

Best Regards

  • | Post Points: 7
Top 100 Contributor
Points 569

Hi Satish,

I have seen your application. How can I make the default 4 to a input from user.

When I am trying to use a variable its not working.

Deepak

  • | Post Points: 7
Top 500 Contributor
Points 153

Hello,

In order to make the default 4 as an input, the only thing you need is to replace the 4 by the name of a variable in the calculated dimension expression. Then create an input box for this variable so that the user can change its value.

BR

  • | Post Points: 7
Top 100 Contributor
Points 569

I got it... I was making a small error in setting the variable.

  • | Post Points: 1
Top 500 Contributor
Points 153

Hi experts!

My problem is not solved. Any idea on how to sort when the second chart dimension is calculated dimension with aggr() function? (see bar chart in the initial post).

Thanks.

  • | Post Points: 1
Page 1 of 1 (8 items) | RSS
Share
Feedback Form