Bird
Raised Fist0
Tableaubi_tool~10 mins

Line charts in Tableau - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a line chart by dragging the correct shelf to the Columns shelf.

Tableau
Drag the [1] field to the Columns shelf to create the x-axis.
Drag options to blanks, or click blank then click option'
ASales
BProduct Category
COrder Date
DCustomer Name
Attempts:
3 left
💡 Hint
Common Mistakes
Dragging a measure like Sales to the Columns shelf instead of a date field.
Using a categorical field like Customer Name for the x-axis.
2fill in blank
medium

Complete the code to add the measure to the Rows shelf for the y-axis.

Tableau
Drag the [1] field to the Rows shelf to plot the values.
Drag options to blanks, or click blank then click option'
ASales
BOrder Date
CRegion
DCustomer ID
Attempts:
3 left
💡 Hint
Common Mistakes
Dragging a dimension like Region instead of a measure.
Using a date field on the Rows shelf instead of Columns.
3fill in blank
hard

Fix the error in the line chart by choosing the correct mark type.

Tableau
Change the mark type to [1] to display a line chart.
Drag options to blanks, or click blank then click option'
ACircle
BSquare
CBar
DLine
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving the mark type as Bar or Circle, which do not create line charts.
Not changing the mark type after adding data.
4fill in blank
hard

Fill both blanks to add a filter and color dimension to the line chart.

Tableau
Drag the [1] field to the Filters shelf and the [2] field to the Color shelf.
Drag options to blanks, or click blank then click option'
ARegion
BOrder Date
CProduct Category
DSales
Attempts:
3 left
💡 Hint
Common Mistakes
Using measures like Sales for filters or colors instead of dimensions.
Not adding any filter or color dimension.
5fill in blank
hard

Fill all three blanks to create a calculated field for cumulative sales over time.

Tableau
CREATE CALCULATED FIELD 'Cumulative Sales' AS RUNNING_[1](SUM([[2]])) OVER (ORDER BY [[3]])
Drag options to blanks, or click blank then click option'
ASUM
BSales
COrder Date
DCOUNT
Attempts:
3 left
💡 Hint
Common Mistakes
Using COUNT instead of SUM for sales aggregation.
Ordering by a non-date field.
Using RUNNING_TOTAL instead of RUNNING_SUM in Tableau syntax.

Practice

(1/5)
1. What is the primary purpose of a line chart in Tableau?
easy
A. To show trends over time or ordered data
B. To display proportions of categories
C. To compare individual values without order
D. To show relationships between two categorical variables

Solution

  1. Step 1: Understand line chart usage

    Line charts are designed to show how data changes over time or ordered sequences.
  2. Step 2: Compare with other chart types

    Other charts like pie or bar charts serve different purposes such as proportions or category comparisons.
  3. Final Answer:

    To show trends over time or ordered data -> Option A
  4. Quick Check:

    Line charts = trends over time [OK]
Hint: Line charts = trends over time or ordered data [OK]
Common Mistakes:
  • Confusing line charts with pie charts
  • Using line charts for categorical comparisons
  • Ignoring the order or time aspect
2. Which of the following is the correct way to create a continuous line chart in Tableau?
easy
A. Drag a continuous date field to Columns and a measure to Rows
B. Drag a measure to Columns and a dimension to Size
C. Drag a dimension to Rows and a measure to Color
D. Drag a discrete date field to Columns and a measure to Rows

Solution

  1. Step 1: Identify continuous date usage

    Continuous date fields create smooth, connected lines in Tableau.
  2. Step 2: Understand discrete vs continuous

    Discrete dates create separate marks; continuous dates create a continuous axis for line charts.
  3. Final Answer:

    Drag a continuous date field to Columns and a measure to Rows -> Option A
  4. Quick Check:

    Continuous date + measure = line chart [OK]
Hint: Use continuous date fields for smooth lines [OK]
Common Mistakes:
  • Using discrete dates for line charts
  • Placing dimensions on Color instead of axis
  • Confusing measure placement
3. Given a dataset with sales over months, what will happen if you drag Order Date (continuous) to Columns and SUM(Sales) to Rows in Tableau?
medium
A. A bar chart with sales for each month
B. A pie chart showing sales proportions
C. A scatter plot of sales vs. months
D. A smooth line chart showing sales trend over months

Solution

  1. Step 1: Analyze continuous date on Columns

    Continuous dates create a continuous axis, ideal for line charts.
  2. Step 2: Analyze SUM(Sales) on Rows

    SUM(Sales) aggregates sales values to plot points connected by lines.
  3. Final Answer:

    A smooth line chart showing sales trend over months -> Option D
  4. Quick Check:

    Continuous date + SUM(Sales) = line chart [OK]
Hint: Continuous date + measure = smooth line chart [OK]
Common Mistakes:
  • Expecting bars instead of lines
  • Confusing continuous with discrete dates
  • Misinterpreting aggregation effect
4. You created a line chart but see disconnected points instead of a line. What is the most likely cause?
medium
A. Using a continuous date field on the Columns shelf
B. Using a discrete date field on the Columns shelf
C. Placing a measure on Color instead of Rows
D. Not aggregating the measure

Solution

  1. Step 1: Identify effect of discrete date

    Discrete dates create separate marks for each date, causing disconnected points.
  2. Step 2: Contrast with continuous date

    Continuous dates create a continuous axis, connecting points with lines.
  3. Final Answer:

    Using a discrete date field on the Columns shelf -> Option B
  4. Quick Check:

    Discrete date = disconnected points [OK]
Hint: Discrete dates cause disconnected points [OK]
Common Mistakes:
  • Assuming continuous dates cause disconnected points
  • Ignoring aggregation importance
  • Misplacing measures on Color
5. You want to compare sales trends for multiple product categories over time in one line chart. Which approach is best in Tableau?
hard
A. Place Category on Columns, continuous Order Date on Rows, and SUM(Sales) on Label
B. Place discrete Order Date on Columns, Category on Rows, and SUM(Sales) on Size
C. Place continuous Order Date on Columns, SUM(Sales) on Rows, and Category on Color
D. Place continuous Order Date on Rows, Category on Color, and SUM(Sales) on Tooltip

Solution

  1. Step 1: Use continuous date for smooth time axis

    Continuous Order Date on Columns creates a smooth timeline axis.
  2. Step 2: Use SUM(Sales) on Rows for measure values

    SUM(Sales) on Rows plots sales values vertically.
  3. Step 3: Use Category on Color to separate lines

    Category on Color differentiates multiple lines by color for easy comparison.
  4. Final Answer:

    Place continuous Order Date on Columns, SUM(Sales) on Rows, and Category on Color -> Option C
  5. Quick Check:

    Continuous date + measure + color by category = multi-line chart [OK]
Hint: Use color to separate lines by category [OK]
Common Mistakes:
  • Using discrete dates causing broken lines
  • Placing category on Rows instead of Color
  • Not using continuous date for time axis
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard