Bird
Raised Fist0
Tableaubi_tool~10 mins

Statistical summary card in Tableau - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a calculated field that returns the average sales.

Tableau
AVG([1])
Drag options to blanks, or click blank then click option'
ASales
CSUM(Sales)
Attempts:
3 left
💡 Hint
Common Mistakes
Using SUM inside AVG causes errors.
Putting quotes around field names.
Using aggregation inside aggregation.
2fill in blank
medium

Complete the code to create a calculated field that returns the median profit.

Tableau
MEDIAN([1])
Drag options to blanks, or click blank then click option'
ASUM(Profit)
BAVG(Profit)
CProfit
Attempts:
3 left
💡 Hint
Common Mistakes
Using SUM or AVG inside MEDIAN.
Adding quotes around field names.
Using aggregation inside aggregation.
3fill in blank
hard

Fix the error in the calculated field to return the standard deviation of sales.

Tableau
STDEV([1])
Drag options to blanks, or click blank then click option'
ASales
BSUM(Sales)
CAVG(Sales)
Attempts:
3 left
💡 Hint
Common Mistakes
Using SUM or AVG inside STDEV.
Adding quotes around field names.
Using aggregation inside aggregation.
4fill in blank
hard

Fill both blanks to create a calculated field that returns the variance of profit for each category.

Tableau
WINDOW_VAR([1], 0, [2])
Drag options to blanks, or click blank then click option'
ASUM(Profit)
BProfit
CLAST()
DFIRST()
Attempts:
3 left
💡 Hint
Common Mistakes
Using aggregated fields inside WINDOW_VAR.
Using FIRST() instead of LAST() for window end.
Leaving blanks empty.
5fill in blank
hard

Fill all three blanks to create a calculated field that returns the coefficient of variation (CV) for sales.

Tableau
[1] / AVG([2]) * [3]
Drag options to blanks, or click blank then click option'
ASTDEV(Sales)
BSales
C100
Attempts:
3 left
💡 Hint
Common Mistakes
Using SUM(Sales) instead of STDEV(Sales) in numerator.
Not multiplying by 100 to get percentage.
Mixing aggregation functions incorrectly.

Practice

(1/5)
1.

What is the main purpose of a statistical summary card in Tableau dashboards?

easy
A. To design interactive maps
B. To display detailed raw data tables
C. To create complex data models
D. To show key numbers clearly and simply

Solution

  1. Step 1: Understand the role of summary cards

    Summary cards highlight important numbers like totals or averages for quick insight.
  2. Step 2: Compare options with this purpose

    Only To show key numbers clearly and simply matches the purpose of showing key numbers simply and clearly.
  3. Final Answer:

    To show key numbers clearly and simply -> Option D
  4. Quick Check:

    Summary card = clear key numbers [OK]
Hint: Summary cards highlight main numbers quickly [OK]
Common Mistakes:
  • Confusing summary cards with detailed tables
  • Thinking summary cards create data models
  • Assuming summary cards are for maps
2.

Which of the following is the correct way to create a SUM aggregation for a measure named Sales in Tableau?

easy
A. SUM([Sales])
B. SUM(Sales)
C. SUM{Sales}
D. SUM: Sales

Solution

  1. Step 1: Recall Tableau aggregation syntax

    Tableau uses square brackets for field names inside aggregation functions.
  2. Step 2: Check each option

    Only SUM([Sales]) uses correct syntax with brackets and parentheses.
  3. Final Answer:

    SUM([Sales]) -> Option A
  4. Quick Check:

    SUM with brackets = SUM([Sales]) [OK]
Hint: Use square brackets for fields inside functions [OK]
Common Mistakes:
  • Omitting square brackets around field names
  • Using curly braces instead of parentheses
  • Using colon instead of parentheses
3.

Given a dataset with Sales values: 100, 200, 300, what will the AVG([Sales]) aggregation show on a summary card?

medium
A. 600
B. 200
C. 300
D. 100

Solution

  1. Step 1: Calculate the average of Sales values

    Sum is 100 + 200 + 300 = 600; count is 3.
  2. Step 2: Compute average

    Average = 600 / 3 = 200.
  3. Final Answer:

    200 -> Option B
  4. Quick Check:

    AVG = sum/count = 200 [OK]
Hint: Average = total sum divided by count [OK]
Common Mistakes:
  • Choosing sum instead of average
  • Picking a single value instead of average
  • Confusing average with maximum
4.

Which of the following formulas will cause an error when used in a Tableau summary card?

IF SUM([Sales]) > 100 THEN 'High' ELSE 'Low' END

medium
A. IF SUM([Sales]) > 100 THEN 'High' ELSE 'Low' END
B. >edoc/edoc<
C. IF SUM([Sales]) > 100 THEN 'High' ELSE 'Low'
D. code>IF SUM([Sales]) > 100 THEN 'High' ELSE 'Low' END

Solution

  1. Step 1: Understand Tableau IF statement syntax

    Tableau IF statements must end with END keyword.
  2. Step 2: Check each option for missing END

    IF SUM([Sales]) > 100 THEN 'High' ELSE 'Low' is missing END, causing syntax error.
  3. Final Answer:

    IF SUM([Sales]) > 100 THEN 'High' ELSE 'Low' -> Option C
  4. Quick Check:

    Missing END causes error [OK]
Hint: Always end IF statements with END in Tableau [OK]
Common Mistakes:
  • Forgetting END keyword in IF statements
  • Using wrong comparison operators
  • Misplacing THEN or ELSE keywords
5.

You want to create a summary card showing the COUNT of unique customers who made purchases over $500. Which Tableau calculation should you use?

hard
A. COUNTD(IF [Sales] > 500 THEN [Customer ID] END)
B. COUNT(IF [Sales] > 500 THEN [Customer ID] END)
C. SUM(IF [Sales] > 500 THEN 1 ELSE 0 END)
D. AVG(IF [Sales] > 500 THEN [Customer ID] END)

Solution

  1. Step 1: Identify requirement for unique count of customers

    Use COUNTD to count distinct customer IDs.
  2. Step 2: Filter customers with sales over $500

    Use IF to include only customers where [Sales] > 500.
  3. Step 3: Combine into calculation

    COUNTD(IF [Sales] > 500 THEN [Customer ID] END) counts unique customers meeting condition.
  4. Final Answer:

    COUNTD(IF [Sales] > 500 THEN [Customer ID] END) -> Option A
  5. Quick Check:

    Unique count with condition = COUNTD(IF...) [OK]
Hint: Use COUNTD with IF for unique conditional counts [OK]
Common Mistakes:
  • Using COUNT instead of COUNTD for unique counts
  • Using SUM or AVG instead of count functions
  • Not filtering with IF condition properly