5 Replies Latest reply: Oct 31, 2016 4:47 PM by Sunny Talwar

# Creat Table Chart with Top 3 in expression

Hello there,

I was trying to create a table chart and I don't know if it's possible.

Let's suppose I have the following data:

I want a chart where I can watch in a column the Sum Sales (No problem on this).
In other column some kind of top 3, showing which Subgroup have higher sales.

For example:

I try to use the rank function but without much success, anybody can send me a clue??

Thanks!

• ###### Re: Creat Table Chart with Top 3 in expression

Try with an expression like this:

Concat(Aggr(If(Rank(Sum(Sales), 4, 1) <= 3, Subgroup), Group, Subgroup), ' - ')

• ###### Re: Creat Table Chart with Top 3 in expression

Or this if you want to sort in the order of their rank instead of alphabetical order:

Concat(Aggr(If(Rank(Sum(Sales), 4, 1) <= 3, Subgroup), Group, Subgroup), ' - ', Aggr(Rank(Sum(Sales), 4, 1), Group, Subgroup))

• ###### Re: Creat Table Chart with Top 3 in expression

Thanks Sunny T, this seems to be working!!

• ###### Re: Creat Table Chart with Top 3 in expression

Hi Sunny T,

I am new to QV so please pardon my silly follow up question, I am going through the below expression,

Concat(Aggr(If(Rank(Sum(Sales), 4, 1) <= 3, Subgroup), Group, Subgroup), ' - ')

Wherein i am not able understand how the value is populated, If i break it and run it till the last step its just a '-' but as soon as concat is added all the code falls in place.