Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
shabarish0587
Contributor III
Contributor III

Bar Chart with top 3 names with Paid Amount

Hi,

Please see the sample data file and screen short. In data file i have two field one field is Hospital Name and second one is  Paid Amount. In Bar chart i want top 3 hospital Names based on Paid Amount.

i have used this expression =aggr(if(Rank(total Sum(Paid_Amount))<=3, Name, Name) in calculated dimension. But i am getting one value Please see the Screen Short in Capture1.   Please any one tell me how to do this.

1 Solution

Accepted Solutions
qlikview979
Specialist
Specialist

Hi ,

PFA,

For me its working

I have 8  products, I am showing here top 7 sales.(if you 10 products and i you show top 8, do like this in expression instead of 7 replace with 😎

Untitled.png

View solution in original post

8 Replies
Anil_Babu_Samineni

May be this? You missed one close parenthesis

=aggr(if(Rank(total Sum(Paid_Amount))<=3, Name), Name)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable

Couldn't you just use dimension limits?

Sergey_Shuklin
Specialist
Specialist

Hello, Shabarish!

You need to use this expression in calculated dimension:

=if(aggr(rank(sum(Paid_amount)),Name)<4,Name)

Or use a Dimension Limits option.

See the attachement below!

qlikview979
Specialist
Specialist

Untitled.png

Do like this

sum({<Name= {'=rank(sum(Paid_amount))<=3'}>}Paid_amount)

PFA

beck_bakytbek
Master
Master

if(aggr(rank(Sum(Paid_Amount),Name) <=3, Name, Null())


Try this


Anonymous
Not applicable

You can restrict that using Dimension Limits option and deselecting others checkbox. Please follow the bellow image.2.PNG

shabarish0587
Contributor III
Contributor III
Author

Hi Mahesh,

          Thanks for Sharing the sample file. If we  give top 3 this expression is working but if we give more than 3 this expression is not working for ex: i want to show top 10 hospitals based on Paid AMount(Means top 10 Paid Amounts i want) when i give top 4 or 5 the values not coming right. Please let me how to this.

Regards,

S.Sabarish

qlikview979
Specialist
Specialist

Hi ,

PFA,

For me its working

I have 8  products, I am showing here top 7 sales.(if you 10 products and i you show top 8, do like this in expression instead of 7 replace with 😎

Untitled.png