0
0
Tableaubi_tool~15 mins

Parameter for top N control in Tableau - Real Business Scenario

Choose your learning style9 modes available
Scenario Mode
👤 Your Role: You are a sales analyst at a retail company.
📋 Request: Your manager wants a dashboard that shows the top N products by sales, where N can be changed dynamically by the user.
📊 Data: You have sales data with columns: Product Name, Category, Sales Amount, and Order Date.
🎯 Deliverable: Create a Tableau dashboard with a parameter control that lets users select the number N, and a bar chart that shows the top N products by total sales.
Progress0 / 8 steps
Sample Data
Product NameCategorySales AmountOrder Date
Wireless MouseElectronics2502024-01-15
Bluetooth SpeakerElectronics4002024-01-20
Coffee MugHome1502024-01-22
NotebookOffice3002024-01-25
Desk LampOffice3502024-01-28
Water BottleHome2002024-02-01
USB CableElectronics1002024-02-03
Pen SetOffice1802024-02-05
HeadphonesElectronics5002024-02-07
Sticky NotesOffice1202024-02-10
1
Step 1: Connect your sales data to Tableau and load the data source.
No formula needed; just connect the data source with columns: Product Name, Category, Sales Amount, Order Date.
Expected Result
Data source is ready in Tableau with all columns accessible.
2
Step 2: Create a parameter named 'Top N' to control the number of top products shown.
Parameter settings: Name='Top N', Data type=Integer, Current value=5, Allowable values=Range from 1 to 10.
Expected Result
Parameter 'Top N' appears in the Data pane and can be adjusted by the user.
3
Step 3: Create a calculated field named 'Rank by Sales' to rank products by total sales.
RANK_UNIQUE(SUM([Sales Amount]), 'desc')
Expected Result
Calculated field 'Rank by Sales' ranks products from highest to lowest sales.
4
Step 4: Create a filter to show only products with rank less than or equal to the parameter 'Top N'.
[Rank by Sales] <= [Top N]
Expected Result
Filter limits the view to top N products based on the parameter value.
5
Step 5: Build a bar chart with Product Name on Rows and SUM(Sales Amount) on Columns.
Rows: [Product Name], Columns: SUM([Sales Amount])
Expected Result
Bar chart shows total sales for each product.
6
Step 6: Apply the filter created in step 4 to the bar chart to show only top N products.
Use filter '[Rank by Sales] <= [Top N]' on the bar chart worksheet.
Expected Result
Bar chart updates to show only the top N products by sales.
7
Step 7: Add the 'Top N' parameter control to the dashboard for user interaction.
Right-click 'Top N' parameter > Show Parameter Control.
Expected Result
Dashboard includes a control where users can select the number N dynamically.
8
Step 8: Create a dashboard combining the bar chart and the parameter control.
Drag the bar chart worksheet and parameter control onto the dashboard canvas.
Expected Result
Dashboard displays the top N products bar chart with a parameter control to adjust N.
Final Result
Top N Products by Sales Dashboard

[Parameter Control: Top N = 5]

| Product Name      | Sales Amount |
|-------------------|--------------|
| Headphones        | 500          |
| Bluetooth Speaker | 400          |
| Desk Lamp         | 350          |
| Notebook          | 300          |
| Wireless Mouse    | 250          |

Bar chart shows bars descending from Headphones to Wireless Mouse.
Headphones have the highest sales amount at 500.
The top 5 products contribute significantly to total sales.
Users can adjust the number of products shown dynamically using the parameter.
Bonus Challenge

Add a category filter to the dashboard so users can view the top N products within a selected category.

Show Hint
Create a category filter on the dashboard and ensure the 'Rank by Sales' calculation respects the category filter context.