I managed to find Top and Bottom values ( max(Value int,[Region]) ) but I don’t know how to display the name of the corresponding shop.
Is it doable? The way I see it requires me to compare two values - Top/Bottom and Value and display the name. I can’t aggregate strings, so I see no way around it for now.
This is a step into right direction, I didn’t even realize that by default LAC will get filtered.
This is the result I have now:
Top Value: maxOver({Value_Int},[Region],PRE_FILTER) Value check: ifelse({Value int}={Top value pre filter},Shop,NULL)
Now, when I see the whole table, I know that top Shop is C. When I filter down to shop C, I will also know that this is the top Shop. However, ideally, I would like to see this info in the whole table, like in the picture no 2 in the original post.
Now, when I filter down to shop B I only know that this is not the top Shop. I’d like to know which shop is the top one:
Current state:
Ideal state:
I know that top Value is 12, so this is Shop C, but I don’t know how to transfer it into a string without aggregating it.
(also, there could be more than one top Shops, but this is further down the line )
Hi @Filo. Checking in. Is this issue resolved? Let me know if I need to deep dive into the problem. In case you need further assistance with your problem, please create a sample dashboard with sample dataset showing your problem state using Arena and post it here. (Details on using Arena can be found here - QuickSight Arena
Summing up the challenge here:
A. I want to know which shop is the top one (C, 12)
B. I want to create a column that will be populated with the top shop (“C” from top to bottom)
C. … so that when I filter to B, I still know that it is C that it the top one with value of 12
D. I am curious how QS will handle the case, when this more than one shop with Top value
So far I managed to achieve A. Column B is not ideal because “C” is only in “C” row. I understand from my experience with other tools that string should be aggregated and I can’t achieve this in QS
Hi @Filo, I think the straight forward solution it at the SQL layer:
WITH RankedShops AS (
SELECT
Region,
Shop,
Value,
MAX(Value) OVER (PARTITION BY Region) AS Top_Value_per_Region,
MIN(Value) OVER (PARTITION BY Region) AS Bottom_Value_per_Region,
RANK() OVER (PARTITION BY Region ORDER BY Value DESC) AS Rank_Desc,
RANK() OVER (PARTITION BY Region ORDER BY Value ASC) AS Rank_Asc
FROM
Source
)
SELECT
Region,
Shop,
Value,
Top_Value_per_Region,
(SELECT Shop FROM RankedShops RS2 WHERE RS2.Region = RS1.Region AND RS2.Rank_Desc = 1) AS Top_Shop,
Bottom_Value_per_Region,
(SELECT Shop FROM RankedShops RS3 WHERE RS3.Region = RS1.Region AND RS3.Rank_Asc = 1) AS Bottom_Shop
FROM
RankedShops RS1
ORDER BY
Region,
Shop;
Did this solution work for you? I am marking this reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the QuickSight Community!
Sorry, I might still be thinking in Tableau/PBI terms and did not explain correctly (or the one row example was not very fortunate), but calculating the value in advance (that’s how I understand the SQL solution) will not work in my example, as I understand the value could be dynamic.
For instance, this is the client that works with the whole dataset:
Hi @Filo, besides using SQL or multiple visuals stacked next to each other – I’m out of ideas. Sorry, currently this is not possible but I’m marking this for feature request. At AWS, our roadmap is primarily driven by our customers. Your feedback helps us build a better service. I have tagged this as a feature request. More features are being added on a regular basis, so please keep an eye on the What’s New / Blog . You can set up a Watching Alert by clicking on the bell icon.