A waffle chart is a simple, aesthetic visualization used to represent proportions or percentages intuitively. Each square in the grid represents a unit of a total value, making this type of graph particularly useful for comparing shares or visualizing a distribution. Often used in marketing reports, financial analyses, or interactive dashboards, it helps decision makers and non-technical teams better understand data while making presentations more engaging and compelling.
Data required:
1 data set, such as the accelerator Hypermarket offered at the bottom of the Tableau Desktop login page,
A measure, for example sales,
Two dimensions, such as Segment and Category.
Step 1: Prepare the data
Create a calculated field and name it Path,
Enter the formula:” IFF ([Segment] =” Company” ,1,100) ”,
Create Classes from the field Path,
Type the waistline From classes to 1,
Create a parameter and name it @colonnes ,
Choose value type as Entire and put the current value to 10.
Step 2: Indexing and positioning
Create a calculated field and name it Index ,
Enter the formula:” Index () -1 “,
Create a calculated field and name it L, for lines,
Enter the formula:” INT ([Index]/[@colonnes]) “,
Create a calculated field C, for columns,
Enter the formula:” [Index]% [@colonnes] ”.
Step 3: Set up the grid
Drag the fields Category and C in the Columns,
Swipe the field L In the Lines,
Swipe the field Path (class) in the tab Detail ofthe landmark,
Right click on the fields C and L and edit Calculated by choosing Path (class),
In the coordinate system, choose the type of visualization to Carré.
Step 4: Add metrics and customize
Create a calculated field and name it Waffle Sales,
Enter the formula:” WINDOW_SUM (SUM ([Sales])) “,
Duplicate the field and name it Waffle Total Sales, don't change the formula,
Create a calculated field and name it Waffle Percentage,
Enter the formula:” [Waffle Sales]/[Waffle Total Sales] “,
Create a calculated field and name it Waffle Color,
Enter color:” IF Index/WINDOW_MAX ([Index]) < [Waffle Percentage] Then “Color” Else “Gray” END ”.
Step 5: Add colors
Swipe the field Waffle Color in the tab colour ofthe landmark,
Right click on the field Waffle color and change the tab Calculated by with Path (class),
Right-click the field again Waffle Color and select Edit the calculation table,
Select field Waffle Total Sales and check the field Category.
Step 6: Finalize the view
Change the axis L and Reverse the axis,
Adjust the colors via the legend,
Swipe the field Waffle percentage in the Columns, between the Category and C fields,
Convert field to discrete value,
Format The field towards Percentages,
Personalize your view.
consultancy
If you want each waffle to have a different color, here are the steps to follow:
Edit the field Waffle Color,
Enter the following formula:” IF Index/WINDOW_MAX ([Index]) < Waffle Percentage Then WINDOW_MAX (MAX_ [Category])) Else “Grey” END “,