Counting The Number Of Products Before Shipping On A Daily Basis

Published: 19 Feb 2018
Last Modified Date: 02 Jan 2020


How to count, on a daily basis, the number of products after and order and before they are shipped.


Tableau Desktop


Option 1

Use a the join calculation feature. For details about this topic, see Tableau Help. Create a data source which includes all dates such as CalendarTable.xlsx.
  1. Open Sample - Superstore by Tableau Desktop.
  2. On the data source tab, click Add and select CalendarTable.xlsx.
  3. Inner join the Orders table and the Calendar table by 1 = 1 with using the join calculation.
    • This means that you need to enter "1" in each join calculation
    • As the result of this step, each row in the Orders table joined to all rows in the Calendar table.
  4. Select Analysis > Create calculated field
  5. Name the calculated field "After Order Before Ship"
  6. Enter the following formula and click OK
    IF [Calendar Date] >= [Order Date] AND [Calendar Date] <= [Ship Date]
    THEN 1 ELSE 0 END 
  7. Place Calendar Date to rows and After Order Before Ship to text.
The above steps can be reviewed in the attached workbook and data source. 

Option 2

If you are using an earlier version of Tableau Desktop, a potential workaround would be to add a common column to both your data sources ; each column should contain "1" in every row.
Did this article resolve the issue?