Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Top 10 In Pivot

Hi,

I know this has been asked and answered few times.I am having a pivot table with Dimensions as Customer Name and Month Name.

Expression as:

=(Count({$<Year_Date={$(=max(Rail_Year))},[Flag Type]={'Rail'},Rail_Size={20}>}Distinct(Conditional_Field))+(vTEU)*(count({$<Year_Date={$(=max(Rail_Year))},[Flag Type]={'Rail'},Rail_Size={40}>}DISTINCT(Conditional_Field))))

Now on the basis of these counts I want to show Top 10 customers.

Please help.

Thanks

18 Replies
antoniotiman
Master III
Master III

Hi,

Try (Calulated Dimension)

Aggr(If(Rank(Expression) <= 10,Customer),Customer)

REgards,

Antonio

Not applicable
Author

Hi Jagan,

It was working, however now my expression is :

=(Count({$<Year_Date={$(=max(Rail_Year))},[Flag Type]={'Rail'},Rail_Size={20}>}Distinct(Conditional_Field))+(vTEU)*(count({$<Year_Date={$(=max(Rail_Year))},[Flag Type]={'Rail'},Rail_Size={40}>}DISTINCT(Conditional_Field))))

+

(Count({$<Year_Date={$(=max(ROAD_YEAR))},[Flag Type]={'Road'},Road_Size={20}>}Distinct(Conditional_Field))+(vTEU)*(count({$<Year_Date={$(=max(ROAD_YEAR))},[Flag Type]={'Road'},Road_Size={40}>}DISTINCT(Conditional_Field)))).

Can you guide me with this?

Thanks

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

=if(aggr(rank((Count({$<Year_Date={$(=max(Rail_Year))},[Flag Type]={'Rail'},Rail_Size={20}>}Distinct(Conditional_Field))+(vTEU)*(count({$<Year_Date={$(=max(Rail_Year))},[Flag Type]={'Rail'},Rail_Size={40}>}DISTINCT(Conditional_Field))))

+

(Count({$<Year_Date={$(=max(ROAD_YEAR))},[Flag Type]={'Road'},Road_Size={20}>}Distinct(Conditional_Field))+(vTEU)*(count({$<Year_Date={$(=max(ROAD_YEAR))},[Flag Type]={'Road'},Road_Size={40}>}DISTINCT(Conditional_Field)))),4,0),CustomerDimensionName) <= 10, CustomerDimensionName)

Note : Replace CustomerDimensionName with your actual dimension name.

Hope it helps you.

Regards,

Jagan.

Not applicable
Author

Hi Jagan,

Everything seems to be working now.One last help.Why its only showing me the Month of 'APR' while updating the data.

Thanks

jagan
Luminary Alumni
Luminary Alumni

Hi,

I didn't get you, is your data is there for all the months?  Check data if it is there then try removing the Year_Date={$(=max(Rail_Year))} in set analysis and check.

Regards,

jagan.

Not applicable
Author

Hi Jagan,

Yes my data is for all the months and if i remove Year_Date={$(=max(Rail_Year))} from my expression,no data is being displayed.

Thanks

jagan
Luminary Alumni
Luminary Alumni

HI,

Attach sample file so that it would be easier to fix it.

Regards,

Jagan.

Not applicable
Author

Hi Jagan,

PFA..and my expression will remain same that we discussed before.

Please help me to show Top10 Customer's

Thanks

SergeyMak
Partner Ambassador
Partner Ambassador

Hi Ankit,

PFA

I used expression

Sum({<[Customer Name] = {"=Rank(SUM(TEUS))<=10"}>}TEUS)


Regards,
Sergey