KNOWLEDGE BASE

How to add columns to show the quantity changes between order date and ship date


Published: 09 Jun 2023
Last Modified Date: 13 Jun 2023

Question

How to add the columns to show the quantity changes between the order date and the ship date
For example:

Before:
User-added image

After:
User-added image

Environment

Tableau Desktop

Answer

1. Create the calculated fields as below.
Name: 1st_day
Value: IF [order date]=[ship date] THEN [quantity] END

Bame: 2nd_day
Value: IF [order date]=DATEADD("day",1,[ship date]) THEN [quantity] END

Name: 3rd_day
Value: IF [order date]=DATEADD("day",2,[ship date]) THEN [quantity] END

2. Drag [Product name] and [ship date] to the row.

3. Drag the calculated fields created as measure values to the view, and drag [Measure Names] to the column.
See the attached sample workbook.
Did this article resolve the issue?