Sharon left a message in my last post on Labeling Trellis Chart Anywhere asking whether we can have one label on the left and another on the right per trellis chart cell in Tableau. Yes we can. Below we will show how to place multiple labels within a trellis cell.

Label's Horizontal Positions 

Assume our data is a time series and the horizontal dimension is Date. Then here are a few examples.

Label on the left is defined by First()=0.Label on the right is defined by Last()=0.Label in the center is defined by Index()=Int(Size()/2)

Here are some of the labels we use in the above trellis chart:

In the label editor, we compose the labels. Both the left label and right labels are placed on the first row. Depending on horizontal positions, some labels are on when the others are off.

Catherine came to my office asking if we can create a compact version from a sparse table in Tableau, so that the table would look a lot more compact. This allows a succinct view of the table content. It saves screen real estate and makes it easy to read for business audience.

I mocked up her problem and this is something she would like to see:

Of course we can. I remember I did something a few years back.

In my previous post on labeling trellis chart, I only showed how to label at the top left corner. People like Chipo Chirewa may want to label elsewhere.

Here I would show how to label anywhere in a trellis cell, like places other than the top left corner.

Vertical Alignment of Labels

In the demo workbook of the previous post, the label height is determined by the axis field

Window_Max(1) 

with fixed vertical axis range from 0 to 1. This places the data mark at the top.
3

[Sequel to this post: Labeling Trellis Chart Anywhere]

To many people, the most difficult part of creating a trellis chart is to label it. Especially labeling it in the same sheet and with sparse data is even harder.

This week's #B2VB project prompted many to create trellis charts for the data set about unemployment in OECD countries.
1

Many times, Tableau is used beyond data visualization. Often we need to perform all sorts of functions. Actually, Tableau is a powerful calculator. Instead of using another tool, such as Python or Excel, we can do it in Tableau proper. Here is a case a colleague asked for: calculating Spearman's Rank Correlation.

For the theory behind Spearman's Rank Correlation, please refer to its Wikipedia page.

Here is a use case at work where the grand total of a table needs to be accumulated horizontally to the right.

In the table, daily sales are shown by categories. The expected result is as follows:

We will use customized grand total technique to calculate it. The formula is as follows:

Usually we use Min(Category)=Max(Category) as the conditional. However because of null values in Sales and table calculations for cumulative sums, that conditional doesn't work in this case.

The term Fill Down is from Excel where we may need to fill all the empty cells below a non-null cell with the same cell value. Excel has a Fill Down button in the menu bar for a single cell fill down. We may also have to fill down between multiple non-null cells in the same column. Here is a post on how to do it. 

This works in the horizontal direction as well.

Tableau created an Add-in for Excel.

In data analysis, we need to use filters here and there. In general, we would classify them as pre-filters or post-filters for better understanding of their respective mechanisms.

A pre-filter works on the data set. It only keeps the data we need for the analysis.A post-filter works on the results. It only keeps the results we need.

In between, calculations are performed on the data, such as aggregations, ranking etc.

In SQL, 

WHERE statement defines what data to keep.
2
Blog Archive
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.