Adding dynamic reference line for today/each day

My project needed me to create a worksheet which will display the data loading batches each day. This essentially was a Gantt chart. The tricky part for me was to add a reference line - which would signify when the data load should start or end by. And every single day the reference line should move to show the current date. 

Here are the steps.

1) Create Parameter
2) Create Calculated Field
3) Add reference line


1) Create Parameter
  1. Right-click in the Data pane and then select Create Parameter.

  2. Name the parameter "param_referenceLine".
  3. Under Data Type select 'Date'.
  4. Under Current Value, add today's date.
  5. Under Allowable values select All.
  6. Click OK.
2) Create Calculated Field
  1. Select Analysis > Create Calculated Field.
  2. Name the calculated field "Reference Line".
  3. In the formula field, enter the following formula: My deadline is that all the data loads should be complete by 7:00 AM so I will add 7 hours to the selected parameter date.
  1. DATEADD('hour',7,[param_referenceLine])
  1. Click OK.

3) Add reference line
  1. Drag the "Reference Line "calculated field to Details.

  2. Click the arrow to change the measure from SUM to Maximum.
  3. In the view, right-click on the Dates axis and select Add Reference Line.

  4. In the Value drop down menu, select 'Reference Line'
  5. In the Label drop-down menu, select Value.
  6. Click OK.
  7. Right-click parameter param_referenceLine and select Show Parameter Control.
  8. Adjust the Data as desired by editing the Parameter Control I renamed as 'Select Date'. 



































Comments

Popular posts from this blog

Tableau Server - reports are loading very slow

Tableau - show value as 0 for No Data or Null

How to check performance of a view on Tableau Server