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. If you need to fill down multiple non-null values frequently, it's a good idea to install the Add-in in your Excel. It helps reshaping the data before feeding it into Tableau.
In Tableau Desktop, it's a little different.
- In Excel, the fill down is at the cell level. A single cell is enough to initiate a fill down.
- In Tableau Desktop, the fill down is at the aggregate level. A companion dimension is needed in addition to a non-null attribute value to initiate a fill down.
For example, a data set is as follows about project management.
To create a project flow chart using Gantt bars, we need to fill down from the left table to the right as follows:Show Missing Dates
First, to generate the Date column, we just need to turn on 'Show Missing Values' in the drop down menu of the Date pill. This is also called data densification in Tableau. This populates the dates between the sparse dates in the original data set.This fills down with sequential dates, instead of an identical value.
Fill Down with String Values
For the Task column which is a string type, we need something like Fill Down. Thus we created a Fill Down formula as follows:
Note that Task New is a table calculation that computes along the Date dimension. This will fill all the null cells with task names below each task's starting date, up to the following task.
We will use Task New to color the dates of each task.
Fill Down with Numeric Values
In general, we can fill down numeric values in similar way to filling down string values above. Just use a similar formula as follows. Max can be changed to other aggregations as needed.
- IFNULL(MAX(Size), PREVIOUS_VALUE(0))
In our particular case, we need to size each cell equally and thus fill down everywhere with the same value 1. There are a number of ways to do this.
1.Use Window_Max(1) to populate all the empty cells.
2.Use Max(1) as Size and turn on Infer Properties from Missing Values in the Analysis menu.
3.Use Max(1) as Size and edit Size legend under discrete Date field as follows.
1 and 2 are fill down solutions with values. 3 is not a real fill down but it does solve the problem. The solutions 2 and 3 are from tableau community members.
Infer Properties from Missing Values in the Analysis menu in combination with Show Missing Values is a great tool to use in case of filling empty data marks with values.
Here is the resulting chart.
The workbook can be downloaded from here.
Feel free to leave comments or contact me at twitter @aleksoft
No comments:
Post a Comment