A Top 3 Calculation-Transcript

Create a calculated field for the Top 3 and encode color and shape in a dual-axis chart.

s1073 Tableau: Dynamic Shape Placement and Transparent "Hacks"

Overview This session demonstrates how to visually distinguish top-performing data points within a bar chart using custom shapes. By utilizing Dual-Axis configurations, Rank-based logic, and Transparent Shapes, you can create sophisticated visual indicators (like yellow diamonds) that automatically track with your data.

Phase 1: Establishing the Dual-Axis Foundation

If you want to place a shape at a specific point along a bar, then you must create a placeholder field to control its exact coordinate.

  • Action: Create a calculated field named Diamond Placement.

  • Logic: SUM([Sales]) * 0.95.

  • Implementation: Drag this field to the Columns shelf and select Dual Axis to overlay it onto your bar chart.

  • Result: This ensures the shape is "nudged" slightly back from the end of the bar (at 95% of the length) rather than sitting directly on the tip.

Phase 2: Identifying Top Performers with Rank

Because the shapes should only appear for specific records, you should implement a ranking calculation to drive the visibility logic.

  • Action: Create a calculated field named Color Top 3.

  • Logic: Use the RANK() function to identify the top three values based on sales.

  • Application: Drag this field onto the Shape and Color tiles of your second Marks card.

Phase 3: The Transparent Shape "Hack"

To hide the shapes for the "Out" group (those ranked 4th and lower), you must utilize a transparent image file within your Tableau Repository.

  • Implementation: Map the "Top 3" group to a yellow diamond shape.

  • The Hack: Map the "Other" group to a custom Transparent Shape (a blank .png file).

  • Result: While the data point exists for every bar, only the Top 3 are visible to the user, creating a clean and focused highlight.

Phase 4: Repository and Preference Customization

To achieve professional branding, you must manage your custom assets within the My Tableau Repository folder.

  • Shapes: Drop your transparent .png file into the Shapes/Custom folder.

  • Colors: Edit the Preferences.tps file to add custom hex codes (e.g., #FFFF00 for transparent/yellow layers).

  • Final Polish: Synchronize your axes and hide the secondary header to ensure the shapes and bars share the same scale.

 

s1073