Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
one of our requirement is need to display top 3 contract Names based on amount value in the Bar chart.But when I trying to display top 3 contract Names it was showing wrong values due to grouped by Contract Name.
Please see below tables and suggest me solution on this to expected results.
Actual Data:-
Contract Number | Contract Name | Amount |
---|---|---|
121 | AAA | 100 |
122 | BBB | 50 |
123 | AAA | 62 |
124 | CCC | 55 |
125 | DDD | 80 |
showing output in the Bar Chart as below:-
Contract Name | Amount |
---|---|
AAA | 162 |
DDD | 80 |
CCC | 55 |
Expected Output as below:-
Contract Name | Amount |
---|---|
AAA | 100 |
DDD | 80 |
AAA | 62 |
Try this script:
Table:
LOAD Dual([Contract Name], AutoNumber([Contract Number]&[Contract Name])) as [Dim Contract Name],
[Contract Number],
[Contract Name],
Amount
FROM
[https://community.qlik.com/thread/233795]
(html, codepage is 1252, embedded labels, table is @1);
Bar Chart
Dimension
[Dim Contract Name]
Expression
=Sum({<[Dim Contract Name] = {"=Rank(Sum(Amount)) < 4"}>}Amount)
I think you should Change your Expression from sum(Amount) to max(Amount)
So you will get the Maximum number for each Contract Name.
Than you can Limit the datas to top 3.
Regards
Check out the attached
Hey there,
Please check out my solution in the attached file:
Best regards,
D.A. MB
miguelbraga -
But this isn't matching the desired output.
Hey Sunny,
I've noticed that, I'm sorry
Your solution is the right one
Thanks mate
MB
Don't have to be sorry my friend. I am pointing it out in a hope that you might come up with another way to do this. I don't like what I have, may be someone else can do better
Best,
Sunny
This should do the work without the aggr function
Best regards
D.A. MB
Dimension limits? Sweet
Thanks for sharing miguelbraga. But try to give more information as the OP might have to look for what you have done.
Best,
Sunny
Hey srinivas b
I've done a Straight Table with a Dimension Limit based upon a Variable that you can change with the slider chart object to have a more flexible table
Best regards,
D.A. MB