I am trying to create a calculated field from multiples columns by each row in Tableau - sql

I have 5 columns.
SAMPLE HIGH MEDIUM LOW TOTAL
A________________5______________4______________7_____16
B________________5______________4______________7_____16
C________________5______________4______________7_____16
D________________5______________4______________7_____16
I want to be able to calculate for each sample the percentage of High Medium Low.
High/ total = new value
medium/total = new value
low/total=new value
How do I do this in Tableau?

You can read here for more details, but the general way is to right click on the Dimensions or Measures small window and then click on Create Calculated Field.
When the windows opens, in your case, you'll want to create a new name for the 'New Value', and then for the Formula section you should put:
[HIGH]/[TOTAL]
Just make sure that these are recognized as floats or integers (and not strings). If you select the variables in the Fields section, you are more likely to get exactly what you want. Also, there is a preview on the right of the data type.

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

Redaction in Tableau

I am currently in the process of building some Tableau workbooks where we will need to redact visualizations or text tables if the results fall below a certain threshold (e.g. only ten data points are returned after filters are applied). Does anyone know how to create calculated fields or know of other methods to redact in Tableau?
You can create a threshold filter that compares the number of filtered responses to a threshold value set in a parameter.
First, create a parameter with integer data type and set it to the desired threshold. In this example, I called it Count Threshold.
Then create a calculated field for the filter with an equation like the following:
{FIXED: COUNTD([Respondent ID]) >= [Count Threshold]}
(I did this for survey results where we needed to hide results if the filtered number of respondents was fewer than 10.)
For the threshold filter to be applied after your other filters, choose "Add to Context" for your other filters.
I found a partial solution on the Tableau community forum/knowledgebase about redaction that might work for other implementations.
The basic idea is to create two different calculated fields, one which displays a integer value and the other that displays a string value. That way, when both are concatenated in the display you get the desired output without breaking any of the calculated field rules.
So create a calculated field that has a formula like:
IF sum([Datafield_to_Redact]) < 10 THEN "*" ELSE str(sum([Datafield_to_Redact])) END
And another that has a calculated field that has a formula like:
IF sum([Datafield_to_Redact]) < 10 THEN null ELSE sum([Datafield_to_Redact]) END
In the post the attached workbook and screenshot show how the two values are concatenated in the Text mark.
Workbook screen capture

How can I populate a SSRS Chart with a calculated field?

I am trying to populate a bar chart in SSRS using the following calculated field:
=COUNT(IIF(Fields!JobDeployment.Value <"1440",1,Nothing))/Count(Fields!CaseStatus.Value)
To explain it is the amount of tasks that have taken under a day to complete divided by the amount of tasks.
This is then attributed as a percentage each month and the end game would be that these percentages are in a bar chart.
Now when I select my bar chart with the Values series being the above calculated field it doesn't return any values
The data is correct in the table so I'm happy with that but when I want it in graph form, I am getting no results.
Could someone please be kind enough to give some pointers as to why this is the case
Thanks
Dan
If you're using Visual Studio (as opposed to Report Builder) you should get an error message explaining why it didn't work. The expressions you can use within charts are limited. Instead, you can have the logic done at the dataset level and leave the aggregation to the chart.
Add a calculated field to your dataset to check your condition.
=IIf(Fields!JobDeployment.Value < "1440", 1, Nothing)
In the chart, just compare the counts.
=COUNT(Fields!FilteredJobDeployment.Value) / Count(Fields!CaseStatus.Value)

Spotfire calculated column based on filter

I want to create a calculated column that is equal to the percent of the total of the previous column, but only for the rows that are selected.
For example, the two columns below show rows where I've filtered for only the rows of interest. The sum is accurate, but I want the percent of the total to be only out of sum of the currently selected rows rather than the absolute total (which is how it's currently being calculated). I want the percent of the total to dynamically change depending on what is filtered in the data table. Is this possible?
Image of my 2 columns:
I know spotfire somehow calculates this becuase when I insert a bar graph using % of Total(SumofComponents) the ratio is only out of the current total.
Image of my bar chart:
much like in programming, Spotfire has a rough concept of scope. and unfortunately, calculated columns are above filters in terms of scope; they have no concept of what is and is not filtered.
visualizations themselves, however, do*!
what you can do in this case is to put your expression on the Y axis (it looks like you've done this), and it will respect your selected filters*.
*caveats: there are a few ways that filtering can be negated on a given visualization:
Properties>>Appearance>>Show shadows indicating the unfiltered data. this option shows a grey bar that represents the data hidden by whatever filter selection was made
Properties>>Data>>Limit data using filterings. these options allow the viz to use separate filtering sets ("Filter Schemes" as they're called in Spotfire) or none at all (to ignore filters completely)
Properties>>Subsets. by default there are three subsets: "All Data" which ignores filters, "Not in current filtering" which inverts the filter selection (e.g., if you filter a boolean column to show only TRUE, this chart would show only FALSE), and "Current filtering" which is the default behavior. you can check the online help for additional subsets that you can add.