how to show YOY metric values as text in a tableau viz - tableau-desktop

please click here for the image
2 questions to the Tableau Sanseis:
The given percentages/numbers in the attachment (shown by parentheses), all belong to the YOY variance and are meant to be displayed in front of the orange (2021) bars
a) Both the numbers/percentages are not showing in one line and current display gives the impression to a user that %ages belong to the blue bars and number to the orange colored bars.
- How to show both in front of orange bars ?
b) Beats me as to why some of the category bars (highlighted with red arrows) don't display any value (no %ages or numbers)
Thanks in advance

Probably "between" your two measure there's some CR, so you see one up and the other down, causing to display just some values and not all.
Something like this:
Go into the Text Mark of your worksheet, and try to dispay your values in just one line with no CR, and you should get something like this:
Sometimes, due to font size and cardinality of your data, some label could be missing just because Tableau tries to optimize the rendering, but you can also check the last option of the Label Mark selecting "Allow Labels to overlap other marks".

Related

Creating Line Between Min and Max in Tableau (Barbell Chart)

I'm creating a chart showing the minimum and maximum salary by level within a company. I have both of these measures displaying as circles. Is it possible to create a bar/line connecting them so that users can clearly see how large the ranges are for each level? I've seen some barbell chart tutorials, but I think I'd need significant data wrangling to get data in a structure that would work for that.
Sidenote: My goal is really just to show the span, so I also thought a stacked bar/column chart could work, with min(salary) as the bottom bar, which I'd make white/transparent, and max(salary)-min(salary) as the top bar, but I could only get them to stack on top of each other when using dual axis.

highcharts - proximate legend items incorrectly assigned (edge case)

This is probably very edge case scenario, but I wanted to know if there is any workaround.
I noticed that when legend align set to right and layout is proximate and when last data points close to each other and bottom legend item has multiple lines in it, it confuses legend order.
Please take a look into this example and the image below:
I'm trying to have legend items ordered by their last value like test1,test2, test3, test longer text4, but instead got two last items mixed up. And it happens only when two last data points close to each other. Other times it worked perfectly.
I've tried to play around with legend.maxHeight, but unfortunately it has no effect.
I appreciate any help!

Modelling DB Structure - Rails

I have a product model wherein the user can customise the product being selected. The user can actually customise the product on two fronts namely size and color. Size options as of now is currently of two types namely size1 and size2. Color options are also similar to that of size where user can select between Black and White irrespective of frame size chosen for now. How can the variant data be modelled effectively in a rails environment? I am looking for the best solution keeping in mind the options for both size and color might grow in the near future. Please let me know what would be the best way to address this?
Here is a class diagram which can help you understand how you should build relationship.
Size and Color will be option_types, size1, size2, Black, White etc will go into option_values
variants with option_value_variants will hold variants like Black Shirt of Size1

How Do I Keep Bar Width the Same Across Multiple Charts?

Suppose I want to create two charts with horizontal bars. The names of the objects are listed on the y-axis and the horizontal bars represents some quantity. The first chart has 100 items and the second chart has 5 items.
When I create the charts the horizontal bars have different widths. I'd like the bars to be the same width across all of my charts.
I know I can try different values for the height parameter to the AddShape function. But that seems time-consuming and unreliable since the number of items can change. I'd like to do something like:
Chart.BarWidth = 10
The "thickness" of each bar will be primarily determined by the number of data points that need to be plotted. The more data points to plot, the thinner the bars will be. There are some options to further tweak them, such as IChartGroup.GapWidth, and you're welcome to try to adjust this so that both charts match. But I suspect that it will be very difficult to do this reliably, particularly if the number of plotted points is expected to change over time.
To maintain the same bar thickness for multiple charts, I think your best option will be to ensure both charts' series refer to the same size range. So if your first chart refers to 100 cells, have your second chart refer to 100 cells, even if only 5 are populated with values. The empty cells should not plot but will still take up space and therefore maintain consistent bar thicknesses between your two charts.

SSRS line chart not connecting data points

I've looked high and low and can't seem to find an answer to what appears to be quite a straightforward issues (I would think).
I have a line chart where there is data at several points in a series but only only one set of points link up.
Does anyone know why this is? Is it to do with my data? If it is, I am struggling to see any relationships in the data that may explain this behavior.
Here is what I mean:
As you can see, the red diamonds should be connecting - the same could be said about the blue squares and the dark blue triangles. Any thoughts?
Apologies if my colors are wrong - I'm colorblind.
Okay, so I worked this out.
Firstly, in order to get the lines to join up, you need to set the EmptyPoint colour for the series.
select your series in your chart
In the properties tab (not the dialog) drill down into the EmptyPoint property and set the colour to be Black
This will get them joining up - yay! But part of the line is colour and the other part is black, right? That's a bit silly, especially considering if you leave the colour to Automatic on the EmptyPoint that it will be transparent.
So, then we need to get the series and the EmptyPoint's colours in sync.
Using code from here. I added some code to the code of the report.
1). Right click on an empty space on the report and select "Report Properties"
2). In the code tab, paste the following:
Private colorPalette As String() = {"#418CF0", "#FCB441", "#E0400A", "#05642E", "#1A3B69", "#BFBFBF", "#E0400A", "#FCB441", "DarkBlue", "Tomato", "Orange", "CornflowerBlue", "Gold", "Red", "Green", "LightBlue", "Lime", "Maroon", "LightSteelBlue", "Tan", "Silver"}
Private count As Integer = 0
Private mapping As New System.Collections.Hashtable()
Public Function GetColor(ByVal groupingValue As String) As String
If mapping.ContainsKey(groupingValue) Then
Return mapping(groupingValue)
End If
Dim c As String = colorPalette(count Mod colorPalette.Length)
count = count + 1
mapping.Add(groupingValue, c)
Return c
End Function
Then we need to call this code when setting the colour of the series and of the EmptyPoint.
Select your series
In the properties tab paste something the following (replace WhateverTheGroupIsForYourSeries with your series group name): =Code.GetColor(Fields!*WhateverTheGroupIsForYourSeries*.Value)
Drill down to the color element of the EmptyPoint Series property
Paste the same text as from point two [e.g. =Code.GetColor(Fields!*WhateverTheGroupIsForYourSeries*.Value)]
And voila! You're done!
I can't believe how unnecessarily difficult this is :D
I just had a problem where it was showing markers but not the lines. I ended up solving it by wrapping the expression in a CInt() to convert it to an integer.
Another way to handle this is to do a recursive select (if you have very large data sets don't do this, it kills performance). So you could make your dataset:
SELECT *, ROW_NUMBER() over(partition by Store order by Date desc) as rn
FROM StorePerformance
Now you can have your category group be rn (it should group by rn and sort by rn) but select date for its label. This will still display the date on your x axis, but since you are grouping by rn the data will still be continuous and all of the lines will connect. Also your legend will still match.
I still haven't looked deeply into how much this shifts the data points since we are plotting with row number and displaying date, but if you are mainly concerned with visualizing trends in the lines and aren't as concerned with where they are at a given point in time in relation to one another, it will serve you just fine. Otherwise I would leave the chart the way it is and just read the plot points, which are still valid data.
Solution
Just put your Fields!(YourSeriesGroup).Value in Series Groups to above of
Fields!(YourCategoryGroup).Value in Category Groups, your series group should be in both Series Groups and Category Groups (should be above of your initial category group).
And after that right click horizontal axis and select Horizontal Axis Properties. Set Axis Type to Scalar and click OK.
Result

Resources