Spotfire - Show top values in stacked bar chart - bar-chart

I have a stacked bar chart that looks like this :
I would like to only show the top 3 bars in terms of value, that is to say the three first bars. I tried to use the Show/Hide feature but it doesn't work as I expected.
For example if I limit to Show top 1 value with the Show/Hide value, i get :
when I expect to also have the orange and blue bars that are stacked in the first picture.
Is there a way to do what I am looking for?

You will have to achieve a dynamic rank and use that to filter out the top 3. Put this rank logic in the hide/show.
It's not clearly given here but in ur dataset you can rank by column on x axis and say rank always less than 3.

I found a better way to do this :
Using the Show/Hide rules of the properties of the visualization, you have to add this rule
DenseRank(Sum([Value]) over (All([Axis.Color])),"desc") <= 3
Then you have to [Axis.Value] in the value input.
3 is the number of bars to have in the bar chart.
[Value] is the column of the Y Axis, in my case I used Count() because my Y axis is (Row Count).
You can find more info at this link : https://community.tibco.com/questions/question-showhide-top-10

Related

How to flip bar chart horizontally in Tableau?

I have made a bar chart using the count of genders & age groups of a dataset. It came as a normal bar chart.
But, I want to flip the chart horizontally. Simply, I want the Y Column on the Right side of the chart, not on the Left side (The traditional way).
N.B.: I don't want to swap the axis i.e. interchanging x and y axis.
I have created this: Created chart
But, I want to create like this:
Desired chart
A very easy thing to try is to edit the axis (by right clicking on the axis and choosing edit, or by just double clicking on the axis. Then you can check the reverse axis option and see if that satisfies you.
The axis will be reversed as you requested but the labels will still be on the left.
Putting the bar labels on the right requires more effort. One way is to make a separate chart that just lists the labels and then combine both on a dashboard

SSRS range bar chart, different color when no data

I am looking to change the color in the "gaps" in the range chart that I have built.
Essentially I am trying to build a visualization for the staff to see the availability on bays. The red markings mean the bay is booked, I wanted green then to be in between the red to highlight free bays.
Occupied bays:
I suspect I need to go back to my dataset and add in some date tables to show "null data" to allow a "switch" to work, but I thought someone might know if I could change this without going this way.
An example of the dataset would be:
Following up
here is a screen shot of my output, i added data labels to see if i was going wrong...HOWEVER I also added shadows to my data and my data is actually still there, just hiding behing my secondary bars......
you are right about my data set, i had to add a series grouping to get my appointments all to appear other wise i was just getting the first appointments on the row only to appear....
Following up 2
A further follow up, I have followed #iamdave 's excellent RangeChart.RDL
I have applied my dataset to it but I am now getting the following output, I know I am probably missing something simple, my gut is telling me the cust_id are seperating all the appointments on to seperate lines yet I have both the primary and secondary axis set to "DrawSideBySide = False"
Here is my set up..
here is my latest output, if I could just group all the rows/bars/lines down to the 6 bays it would be great.
You can do this by adding in another data series based on your original dataset, that will require significantly less processing than filling in all your empty periods as suggested by WEI_DBA.
In your dataset, add a new column that returns dense_rank() over (order by BAY) as BayID (order by should be your desired axis label).
This may be best done as a wrapping select statement to preserve the rest of the query logic as is.
In your Range Chart, add in another Values item, with the same Category Field as your current one.
Set the Top Value to 1 and your Bottom Value to 0.
You could also set this to the min and max time of your dataset or the start and end period of your report to only cover the period the Bay was available.
Set it to display on the Secondary Axis for both Vertical and Horizontal axes.
Also select the Do not show this series in a legend option.
Set up the Secondary Vertical Axis in exactly the same way as your Primary Vertical axis.
Set the Secondary Horizontal Axis Minimum and Maximum to the same values as your Bottom and Top above.
Hide both the Secondary Axes.
Select the new Values item and in the Properties window, expand the CustomAttributes section and change DrawSideBySide to False.
If necessary, adjust the order of the Values items in your Chart Data window to make sure the new Range Bar displays underneath your actual data.
Select the original Values item and in the properties sidebar navigate to Data > DataPoint:
Change AxisLabel to =Fields!BAY.Value (Your axis label).
Change Values > X to =Fields!BayID.Value (Value from point 1.).
You should now have a range chart that that displays your data on top of a solid bar, that you can set to any colour you require:

SSRS Match Color series in stacked bar chart

I have a stacked bar chart, with year on the x axis, and sales CY and sales LY on the y axis, also the bars are grouped (stacked) by company name, like in the picture below:
bar chart stacked example
The problem is I want to match the colors for the same companies, like: "united package CY" and "united package LY" have the same color for both, so will be easier to see the comparison between companies and years.
Is there any way to achieve this?
Thanks!
Yes you can, click on your chart and go to the chart properties on the right side under:
Chart > CustomPaletteColors.
Here you can add your defined chart colurs for each series. For example if you have 4 series you have 4 different colors. You can set the color for series1 the same as series2.
Depending on which positions your series are, they will look like one section or they will have another color between them. But you can reorder the position of the series if you need to.

SSRS - Major/minor gridlines spacing

I have an SSRS report with a bar chart with multiple series by CountryName Category group. What I want to do is have gridlines which split each country like below:
However in SSRS the major gridlines seem to interval with the line in the middle of the country name when the grid interval is set to 1 like below:
Can someone point me in the right direction into how to rectify this?
Also is there a way of adding the X axis in SSRS to start from zero like I have in my first graph?
Thanks
You can do it, there is an offset property on the grid lines (horizontal and vertical are separate). Click one one of the gridlines and look in the properties pane. Change the offset to 0.5.
Gives you this.
I'm not sure what you meant about starting from zero on the X-Axis, you have negative values so you'll start from a negative number. If you meant you wantde zero aligned to the middle. You can do that to. You need to set the min and max values of the horizontal axis to the following
Min Value:
=MAX(ABS(Fields!MyValueField.Value), "MyDataSet")*-1
Max Value will be:
=MAX(ABS(Fields!MyValueField.Value), "MyDataSet")
Basically we take the ABSolute largest value and use that as the extent (*-1 for the min value). The problem is that zero might not show so you'll have to play around with the Axis properties maybe to get that working. I'm sure it's possible but I don't have time to test at the moment.
My test data is not great as the number are large

Horizontal Axis Properties

In my chart, Incomprehensible what value of Y axis belong to X axis, what the best way to present the chart clearly. Attached Image.
Have you considered using StripLines?
Taken from this MSDN article
To show vertical strip lines, right-click the horizontal chart axis and click Horizontal Axis Properties.
Select the Use interlacing option. Grey strip lines will appear on your chart.
Applying this to a chart will then alternate the colour for each category on the X axis, such as this. This will make it clearer which columns belong to which X axis category.
Update
For use with a 3D Clustered column chart you will need to set up the Striplines in a more complicated way.
Select your X axis and find StripLines in the properties. Hit the '...' to open a new window.
Add a New Member and set it up as shown in the below image. This is effectively saying show a line for every second number, and offset the stripline by 0.5 of a category.
In my example I have set the BackgroundColour to MidnightBlue also, which gives an output similar to
With this alternating background it should make it clearer for your users to see which columns belong to which category.
Let me know if you need further assistance with this.