How to show/add the legend in a dual axis chart? - data-visualization

I have created a dual axis chart where I'm graphing the arrival time and the departure time in the same graph, and showing the sum of the number of records as the rows.
By default Tableau adds the "Measure Names" into each of my columns Marks and I get an automated Legend showing the "Number of Records" in one colour.
However, this is not useful at all...
I want each time variable (eg. arrival time) to show up in a different colour. The only way I have been able to do this is by removing the "Measure Names" pill from the Marks card and then setting each axis to have its own colour. But as soon as I do this, the Legend disappears and now I finally get a nice graph with a line in each colour, but no legend to show what line is assigned to what colour.
Also the Legend option gets disabled when I use this layout.
How can I add the Legend to this?
Please note that the solution in this post doesn't help to answer this question.

You should be able to create 2 calculated fields that basically mimic Number of Records like
SUM([Number of Records])
Once you have 2 calculated fields, you can name them each what you desire. Then you should be able to use measure names and those separate calculated fields on each card of your dual axis.

Many, but not necessarily all, views people want to make with job start/arrival and end/departure records are easier if you reshape the data to have one data record recording each state-change event, tied by a common key.
So if your data has columns for Date, ID, Event, User -- where Event can be either Arrive or Depart -- then most visualizations will be much easier. In this view, each user that has arrived and departed will get 2 records instead of just 1. And customers that have arrived but not yet departed will get 1 record.
You can leave your original data in its original form and create this reshaped view in a Tableau Data Source using either Tableau Prep or the DataSource page in Tableau Desktop. You'll need to use the Union operator. That way you can have another data source that points to the original format if that is useful also.

Related

Tableau: Self-Organizing Map visualization

So, it's my first time trying to make my own data visualization, and what I want to do is something like a heat map or highlighted table like the original Kohonen (but using squares rather than hexagons) research about countries, but I don't know how to apply it to the map I've got from training the network.
I've read a few links about making a highlighted table and heat map on Tableau, but what I get is always just a table mainly because I'm not using a measure (i just want every country of one color), so, my question is: is it possible to use Tableau for this situation and if so, how could I do it? Thanks!
Original SOM visualization from Dr. Kohonen
Table from Tableau
Yes it is possible to make visualizations like you describe in Tableau - but the question you posed is a bit vaguely specified to give you much more detailed guidance than first take some Tableau training.
For instance, how do you want to determine which row and column to place a country? You may need to write a table calc for row and col positions, which means learning about table calcs. Or you can assign them in a data column.
For square country marks, you'll want a discrete field on the rows shelf, a discrete field on the columns shelf, possible a dimension like Country name on the details shelf. Choose a square mark type, and (important) choose a square cell size from the format menu. Then adjust the size of your squares from the size button and the format menu, and colors and borders from the color button and format pane.
Lots to play with.

How to convert a panel bar chart to multi-line chart in tableau

I am trying to create multi-line subplots such that each subplot represents a rating factor on which firms are rated, and each line represents a firm's change in rating over time. Note that I don't have the date field. I have a string field that says which quarter of the year the Mean of ratings belong to.
I'm new to tableau and I created something like this:
I want to create multiple subplots: one subplot for each of the 8 rating features in the above diagram, and the subplot has multiple lines representing the variation over time for each company. I have 10 companies.
Please guide me on how to achieve this?
A rough sketch of how I Imagine the plot to look like is below:
This will teach you how to make a panel chart in Tableau: https://tarsolutions.co.uk/blog/build-a-dynamic-panel-chart-in-tableau/
It shouldn't to too complex for what you're attempting (fingers crossed!).
Building the panel chart is a little tricky in Tableau. Not terribly hard once you understand table calcs. I suggest starting simpler by moving Measure Names from the Rows shelf to the Pages shelf, then creating the line charts you want - 1 per page. Then learn about table calc partitions and addressing, including “At the Level” to have the info needed to define the panels
To make a colored line chart,
You need one field on columns that you set to display as continuous, making it green. If it is a date field, right click on the field and choose from the second set of groups, like month or quarter.
You need a continuous field on the Rows shelf, use Measure Values in your case
Use a discrete field on color to determine the number of lines, say Shortname
Set the Mark Type to either Automatic or line

Three items (Current value, trend and YTD) in single panel in Splunk

We've setup a new Splunk dashboard and I'm looking to improve the trend graphs/panels.
We now have three panels each telling us something about a specific type of event. These panels are shown in the screenshot below:
Top to bottom,
the first shows the number of events in the current rolling period (of 30 days).
The second shows a trend graph of the number of events every day over the past 3 months.
The third and last shows the number of events in this year to the current data (YTD).
I'd like to clean this up and combine it into one panel. Ideally it would look something like:
I've been messing with CSS files, but that is not a sustainable solution.
Also I've found the Splunk documentation on how to Generate a single value. This give me part of what I'm looking for. But this lacks the Year to Data value and I need the trend line to be more prominent.
Any suggestions to how to make this work?
You want to create a custom visualization of a numeric value. I would suggest you start by looking into existing numeric value visualizations from Splunkbase, then customize the visualization code (html/css/js) to do what you need it to.
From a quick view I just had, there is Number Display Viz which also has source code available under the GPL on github: https://github.com/ChrisYounger/number_display_viz
To show all three datapoints on a single panel, you can either tweak the html to retrieve data from three different searches, or use sub-searches to provide all data as a single result.
Consider putting all three visualizations in a single panel. You'll need to edit the dashboard's source to do that, but it's very simple. Just remove the </panel></row><row><panel> tags between the visualizations.
A simpler option would be to move the three panels onto the same row so they're next to each other.

PowerBI Dynamic Time Series BarChart

Adding on my previous question here: TimeSeries question
I would like to plot a unit capacity chart over a Time series (which contains a range of dates set by the user).
The chart I am trying to plot is as follows:
For each Unit Name, I have start and end date for the unit capacities, as shown in the PowerBI table as below:
4 sub questions:
How to plot these capacities over time? Maybe using some DAX functions?
Do i need the SSAS cube to solve this problem or can I do all the work inside PowerBI desktop? If not, is there a better way for example in SSRS?
Is there a way to make the x-axis time series dynamic as specified by the user?
Adding to this, after Leonard's response. After converting the OutageStartDateOrig, and OutageEndDateOrig values I tried to create the calculated column as suggested in the youtube link {enter link description here}. However, the DAX formula as shown in the video gives out a syntax error for me stating that the '.' is incorrect when specifying the range of dates. Any ideas for this? [Screenshot below]:
To create such a visual, I'd recommend an area chart (or stacked area chart) with the date on the axis, the unit name on the legend, and the capacity on the values. You could also do it as a stacked column chart too. However, then each date will be broken into discrete columns. See below image.
In terms of data manipulation, you'll need to convert the data with the date ranges you have above into a row for each individual date & unit. E.g. the first row, instead of being 11/2 to 13/2, would be expanded into 3 rows, one for each date.
You can do this in Power Query as you bring the data into Power BI Desktop, or in DAX after bringing it in. There are several solutions to this outlined in this thread (https://community.powerbi.com/t5/Desktop/Convert-date-ranges-into-list-of-dates/td-p/129418), but personally, I recommend the technique (and video) posted by MarcelBeug (https://youtu.be/QSXzhb-EwHM).
You'll also want an independent list of dates (with no gaps) to join the final date column to - otherwise your visual will skip dates when no units had capacity. By default, the chart will begin on the first date with data and end on the last date with data, so in that sense it is dynamic, but you can add a date slicer to give the end-user more control.
Area chart on top, column chart on bottom, date slicer on right filtering Jan-Mar.

SSRS Matrix Report : Colors condition

I have a matrix table created with Rows as Days ,Columns as Months and quantity of rainfall as the data field(got all this information from same table 'Rainfall'). I have taken this data from a dataset containing multiple tables in SQL. All of this information displays properly.
Now I have many tables with date field in my dataset in tables other than 'Rainfall'.
In the data field of the matix I need to be able to add my own colors using a Switch case.
The Condition I need is "if a certain date from one table matches the date in my report then i want xxx colour."
eg: there is a table called fertilization which has 3 dates. Now if these 3 dates also exists in my matrix then that block should be colored blue.
Can anyone help me. Thanks!
You can also manage it from sql side while retrieving data from Rainfall table.
You can do this using by right clicking the field that you want the dynamic color on and selecting properties. Select Border and then where it says color hit, click the Fx button. Here you can write a custom expression that will change the background color based upon your code.