
Every date field must have at least one record for the date level used in the view. Drag CNTD(Order ID) from Detail on the Marks card over the numbers in the view and drop the fieldĪdditional Information Notes on Option 2 (Level of Detail expression):. Right-click and drag from the "Sample - Superstore (link on ship date)" data source onto Text on the Marks label. In the Drop Field dialog, select CNTD(Order ID) and click OK. Right-click and drag from the "Sample - Superstore (link on order date)" data source onto Text on the Marks label. In the Edit Alias dialog, type in a more descriptive name and click OK. In a new worksheet, right-click and drag from the "Sheet1 (master date list)" data connection into the view. Click OK to close the Relationships dialog. Repeat steps 4-5 with "Sample - Superstore (link on ship date)" as the secondary data source, and adding a relationship on MY(Date) = MY(Ship Date). Select the matching date level for Order Date. In the right pane, click the arrow next to Order Date. Select the date level that matches the most granular date level used in the view. Click the arrow next to Date to expand the date options. In the Add/Edit Field Mapping dialog, do the following:.
For secondary data source, select Sample - Superstore (link on order date).For Primary data source, select Sheet1 (master date list).In the Relationships dialog, do the following:.In this example, I have named the two copies of "Sample - Superstore" as "Sample - Superstore (link on order date)" and "Sample - Superstore (link on ship date)" for clarity. Navigate to Data > Sample - Superstore > Duplicate.In this example, that connection is called "Sheet1 (master date list)" Create a table that contains a master list of all possible dates, and create a new connection to that list.This option will not work for a range of dates. Double-click in the data pane to add the field to the view.In the Drop Field dialog, select MY(Date) and click OK.In the formula field, create a calculation similar to the following:.
In this example, the calculated field is named "Orders Placed" In the Calculated Field dialog box that opens, do the following, and then click OK:.Select Analysis > Create Calculated Field.
Add the "Sheet 1" table to the canvas area. Navigate to the Data source tab in Tableau Desktop. In this example, that table is called "Master Date List" Create a table that contains a master list of all possible dates, which will be joined to the original data connection. This option requires that one date field always come before another date field, and works best when the two dates fields are defining a range. Double-click in the data pane to add the field to the view
IF DATETRUNC('month', ) = DATETRUNC('month', )
Create a calculated field with a name like "Orders Shipped" with a calculation similar to the following:. In the Edit Alias dialog, type in a new name and click OK. Right-click the header "Distinct count of Order ID" in the view and select Edit Alias…. In the Drop Field dialog, select CNTD(Order ID). Right-click and drag to Text on the Marks card. In the Drop Field dialog, select MY(Order Date) with the blue # icon and click OK. Right-click and drag to the Rows shelf. Choose one date field to create the date axis or headers. In this example, every row is a month, therefore both and need to have at least one order for every month. This option requires that every date field have at least one record for every date bin in the view.