Tableau is a great platform that is extremely flexible and I use that everyday at work to analyse data and helps to uncover insights that drive key decisions. During my off work hours I really enjoying pushing the limits of Tableau and try to visualise data in a different way. One day I was preparing for a presentation for work and was thinking for ice breaker ideas that I can use during my presentation. It was like a light bulb moment and I decided to use Tableau visualisation as a ice breaker in the form of game “Spin to Win”

This was my first game in Tableau. Games in tableau are all about data which tells a interactive story to engage an audience. Everything in this game is about data: the location of an arrow, the rotation of the board, numbers placed on the wheel, speed of the wheel, order in which it rotates. There were lots of challenges but all of them were fun and exciting. They allowed me to push the limits of tableau.

Lets work on how to build “Spin the Wheel” in tableau.

Dataset

The main part of this game is data. So lets look into the data set that I have used

  • Manually plotted the X and y coordinates for the position of an arrow when it rotates on the wheel.
  • Wheel Order is the order in which the wheel will rotate.
  • There are total of 37 numbers on the wheel i.e. 0 – 36.
  • Number field show the numbers from 0 – 36 with different permutation and combinations
  • Rotation column give us the total of 500 combination which can be adjusted based on the requirement. From row number 279 the rotation number will repeat twice to slow down the speed of the wheel. As the wheel gets closer to stopping, the rotation number will repeat multiple times. Data set should look something like below and can be downloaded along with tableau twbx file on tableau public Spin to win.
Worksheet

We will now look into building our first worksheet

  • Change the Mark Typeto Pie.
  • Drag Wheel Order to Details
  • Drag Number into Colour
  • Drag Rotation to pages
  • Type 1 to columns in green pill

It will look something like below:

  • Press Ctrl and drag 1 to create a duplicate on column self
  • Right click on second column to create dual axis
  • Drag Wheel Order to Details
  • Drag Number into Colour
  • Drag Number into Text

It will look something like below:

Now that we have the Wheel setup , we need to place the arrow on top of these numbers and spin the wheel and the arrow at the same time. So lets work on getting the arrow part setup:

For this I used another dataset with numbers from 0 – 36 and randomly picked the number from that dataset. Once the number is randomly picked from the data set, I have used the calculation pick the winner and add that to the filter. So everytime  a random number will be selected as a winner.

Calculation:
@winner :

To pick the winning number

if ATTR([RandomCalc (2)].[Outcome]) = ‘WINNER’ then 1 else 0 end

  • Drag Ball X into Columns
  • Drag Ball Y into Rows
  • Drag Number(int) and Winner into Details
  • Drag Rotation to Pages
  • Drag Selected number into Each number will have separate arrow shape which will rotate with the wheel in opposite direction.

It will look something like below

Once we have the frame with arrows and wheel setup, we need to over lay frame with arrows on top of wheel and after doing some formatting it will look something like below and can be accessed on tableau public by clicking Spin to Win

Hope you enjoyed this tutorial and will have fun playing it too 🙂