Complete the code to create a continuous date axis in Tableau.
DATEPART("[1]", [Order Date])
Using YEAR in DATEPART creates a continuous date axis by year.
Complete the code to create a discrete date field in Tableau.
DATETRUNC("[1]", [Order Date])
Using MONTH with DATETRUNC creates a discrete date field by month.
Fix the error in the year comparison calculation.
IF DATEPART("year", [Order Date]) = [1] THEN [Sales] END
The year value should be a number without quotes: 2023.
Fill both blanks to sum sales for January 2023.
SUM(IF DATETRUNC("[1]", [Order Date]) = [2] THEN [Sales] ELSE 0 END)
DATETRUNC with MONTH truncates dates to month start, and comparing to DATE('2023-01-01') filters January 2023.
Fill all three blanks to create a discrete date filter for sales in January and February.
IF DATENAME("[1]", [Order Date]) IN ([2], [3]) THEN [Sales] ELSE 0 END
DATENAME with MONTH returns month names; filtering for January and February selects those months.
