Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a primary data source connection in Tableau.
Tableau
PRIMARY_CONNECTION = tableau.[1]('Sales_Data')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'blend' instead of 'connect' to start a data source.
Confusing 'join' with connecting data sources.
✗ Incorrect
In Tableau, connect is used to establish a primary data source connection.
2fill in blank
mediumComplete the code to blend a secondary data source on a common field.
Tableau
blend = primary.blend(secondary, on='[1]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a field that does not exist in both data sources.
Using a unique identifier that is not common across sources.
✗ Incorrect
Blending usually happens on a common field like Region to combine data sources.
3fill in blank
hardFix the error in the code to correctly blend data sources in Tableau.
Tableau
blended_data = primary.blend(secondary, on=[1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the field name without quotes causing syntax errors.
Using incorrect capitalization without quotes.
✗ Incorrect
The field name must be passed as a string with quotes, like 'Region'.
4fill in blank
hardFill both blanks to create a calculated field that sums sales from the primary and secondary sources.
Tableau
Total_Sales = [1] + [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using AVG or COUNT instead of SUM for sales totals.
Mixing up primary and secondary source references.
✗ Incorrect
To sum sales from both sources, use SUM on each source's sales field.
5fill in blank
hardFill all three blanks to filter blended data for the year 2023 and region 'West'.
Tableau
filtered_data = blended_data.filter([1] == [2]).filter([3] == 'West')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect field names like 'Month' instead of 'Year'.
Not quoting the year value correctly.
✗ Incorrect
Filter by Year equal to 2023 and Region equal to 'West'.