Bird
Raised Fist0
Tableaubi_tool~20 mins

Data relationships model in Tableau - Practice Problems & Coding Challenges

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
Challenge - 5 Problems
🎖️
Data Relationships Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Tableau Data Relationships

In Tableau, what is the main advantage of using a data relationship model over a traditional join?

AIt permanently merges all tables into one large table before analysis, reducing query time.
BIt disables filtering between tables to avoid data duplication.
CIt allows Tableau to maintain the original tables separately and combine data only when needed, improving performance and flexibility.
DIt requires all tables to have the same number of rows to work correctly.
Attempts:
2 left
💡 Hint

Think about how Tableau handles data at query time versus data preparation time.

❓ dax_lod_result
intermediate
2:00remaining
Result of a Relationship Filter in Tableau

Given two tables: Orders and Customers related by CustomerID, if you filter Customers to only those in 'USA', what happens to the Orders table in a relationship model?

AOnly Orders with CustomerID in USA are included in the view.
BAll Orders are shown regardless of Customer location.
COrders table is filtered first, then Customers are filtered.
DThe filter causes an error because relationships do not support filtering.
Attempts:
2 left
💡 Hint

Consider how filters propagate through relationships in Tableau.

❓ data_modeling
advanced
3:00remaining
Modeling Many-to-Many Relationships

You have three tables: Students, Courses, and Enrollments. Students and Courses have a many-to-many relationship through Enrollments. How should you model this in Tableau using relationships?

ACreate a relationship only between Students and Courses, ignoring Enrollments.
BJoin Students and Courses directly on StudentID and CourseID.
CMerge all three tables into one flat table before importing to Tableau.
DCreate relationships from Students to Enrollments and from Courses to Enrollments, keeping all tables separate.
Attempts:
2 left
💡 Hint

Think about how to represent many-to-many relationships without losing detail.

🔧 Formula Fix
advanced
3:00remaining
Troubleshooting Incorrect Aggregation in Relationships

You created relationships between Sales and Products tables. When you add Product Category and sum of Sales Amount to a view, the totals are incorrect and inflated. What is the most likely cause?

AThe Products table has missing Product Category values causing nulls.
BThe relationship is many-to-many and Tableau is duplicating sales when aggregating by category.
CThe Sales Amount field is not numeric, causing aggregation errors.
DThe relationship is inactive and needs to be activated manually.
Attempts:
2 left
💡 Hint

Consider how many-to-many relationships affect aggregation.

🎯 Scenario
expert
4:00remaining
Designing a Flexible Sales Dashboard with Relationships

You need to build a sales dashboard that shows sales by region, product, and time. The data source has separate tables for Sales, Regions, Products, and Dates. You want to allow users to filter by any dimension without duplicating data or creating complex joins. What is the best approach using Tableau's data relationships?

ACreate relationships from Sales to Regions, Products, and Dates tables, keeping them separate and letting Tableau combine data dynamically.
BJoin all tables into one large table before importing to Tableau to simplify filtering.
CUse data blending instead of relationships to connect the tables.
DCreate calculated fields in Sales to replicate Regions and Products data for filtering.
Attempts:
2 left
💡 Hint

Think about how Tableau relationships optimize performance and flexibility.

Practice

(1/5)
1. What is the main purpose of using data relationships in Tableau?
easy
A. To delete unrelated tables automatically
B. To permanently combine tables into one
C. To create duplicate copies of data
D. To connect tables without merging them immediately

Solution

  1. Step 1: Understand what data relationships do

    Data relationships link tables by matching key fields but keep tables separate until analysis.
  2. Step 2: Compare with other options

    Options A, B, and C describe deleting, permanently combining, or duplicating, which are not the purpose of relationships.
  3. Final Answer:

    To connect tables without merging them immediately -> Option D
  4. Quick Check:

    Relationships connect tables without merging [OK]
Hint: Relationships link tables without merging data [OK]
Common Mistakes:
  • Confusing relationships with joins
  • Thinking relationships merge tables immediately
  • Assuming relationships duplicate data
2. Which of the following is the correct way to create a relationship between two tables in Tableau?
easy
A. Write a SQL JOIN statement manually
B. Drag a field from one table to the matching field in another table
C. Copy data from one table and paste into another
D. Use the Data Interpreter to merge tables

Solution

  1. Step 1: Identify how Tableau creates relationships

    Tableau allows creating relationships by dragging a key field from one table to the matching field in another.
  2. Step 2: Eliminate incorrect methods

    Options A, C, and D describe manual SQL, copying data, or using Data Interpreter, which are not how relationships are created.
  3. Final Answer:

    Drag a field from one table to the matching field in another table -> Option B
  4. Quick Check:

    Drag matching fields to create relationships [OK]
Hint: Drag matching keys between tables to create relationships [OK]
Common Mistakes:
  • Trying to write SQL JOINs instead of using drag-and-drop
  • Copy-pasting data instead of linking tables
  • Confusing Data Interpreter with relationships
3. Given two tables: Orders with fields OrderID, CustomerID and Customers with fields CustomerID, CustomerName, what will happen if you create a relationship on CustomerID and then create a view showing CustomerName and count of OrderID?
medium
A. The view shows each customer with the number of their orders
B. The view shows all orders without customer names
C. The view shows customer names but no order counts
D. The view causes an error due to missing join

Solution

  1. Step 1: Understand relationship on CustomerID

    Relationship links Orders and Customers on CustomerID, allowing data from both tables to combine logically.
  2. Step 2: Analyze the view with CustomerName and count(OrderID)

    Tableau aggregates orders per customer, showing customer names with their order counts.
  3. Final Answer:

    The view shows each customer with the number of their orders -> Option A
  4. Quick Check:

    Relationship on CustomerID aggregates orders by customer [OK]
Hint: Relationship on key fields enables combined aggregation [OK]
Common Mistakes:
  • Expecting no aggregation without explicit join
  • Thinking relationship causes errors
  • Assuming customer names won't appear without join
4. You created a relationship between two tables on ProductID, but your view shows incorrect totals. What is the most likely cause?
medium
A. The relationship was created on non-matching fields
B. The tables are physically merged instead of related
C. You forgot to refresh the data source
D. The relationship uses fields with different data types

Solution

  1. Step 1: Check the fields used in the relationship

    If the relationship is created on fields that do not match correctly, the data will not combine as expected, causing wrong totals.
  2. Step 2: Evaluate other options

    Data type mismatch usually prevents relationship creation; physical merge creates a single table instead of relating; refreshing rarely fixes relationship logic errors.
  3. Final Answer:

    The relationship was created on non-matching fields -> Option A
  4. Quick Check:

    Incorrect totals often mean wrong relationship fields [OK]
Hint: Verify relationship fields match exactly to fix totals [OK]
Common Mistakes:
  • Ignoring field mismatches in relationships
  • Assuming refresh fixes relationship logic
  • Confusing relationships with joins or merges
5. You have three tables: Sales (with SaleID, ProductID, DateID), Products (with ProductID, ProductName), and Dates (with DateID, Date). How should you set up relationships to analyze total sales by product name and date?
hard
A. Create a relationship from Products to Dates directly
B. Join all three tables into one large table before analysis
C. Create relationships from Sales to Products on ProductID and from Sales to Dates on DateID
D. Create relationships from Products to Sales on ProductName and from Dates to Sales on Date

Solution

  1. Step 1: Identify keys for relationships

    Sales table contains foreign keys ProductID and DateID linking to Products and Dates tables respectively.
  2. Step 2: Set relationships on matching keys

    Create relationships from Sales to Products on ProductID and from Sales to Dates on DateID to enable combined analysis.
  3. Step 3: Eliminate incorrect options

    Joining all tables into one is not necessary; relating Products to Dates directly lacks a direct key; using ProductName and Date for relationships are incorrect keys.
  4. Final Answer:

    Create relationships from Sales to Products on ProductID and from Sales to Dates on DateID -> Option C
  5. Quick Check:

    Relationships use foreign keys from fact to dimension tables [OK]
Hint: Link fact table keys to dimension tables for analysis [OK]
Common Mistakes:
  • Trying to relate dimension tables directly without fact table
  • Using descriptive fields instead of keys for relationships
  • Joining tables unnecessarily instead of relating