2021: Week 22 - Solution

 

Solution by Tom Prowse and you can download the workflow here. 

This week's challenge was a bit of fun where we looked to try and replicate on of the games from the UK TV show 'Richard Osman's House of Games'. We were trying to replicate the final round called Answer Smash, where you have to combine a picture with a question to get your answer. 

We have tried to replicate this with a few of the Preppin' Data regulars and some different categories linked to their names. Lets look at how we solved the challenge!

Step 1 - Clean Category Field

First up we need to clean the category field by splitting apart the two parts; Category & Answer. These are split by a ':' and we can use an automatic split to bring these into two columns. After the split we can rename the fields and remove the original so that our table looks like this: 


Step 2 - Join Data Sets

The next step is to combine our data sets together by joining them. First we want to join the Answer Smash table with the Questions table, with the join condition Q No = Q No:



The next join is to bring in the category table. This time we are joining on Category =Category: 


After this join our number of rows has increased massively due to there being lots of categories. We only want to keep the categories where the Answer is within the Answer Smash field. Therefore we can filter the results with the following calculation: 

CONTAINS([Answer Smash],[Answer])

This brings us back to 20 rows and our table looks like this: 


The final join that we need to do is bring in the Names table. This time we join on Answer Smash != Name, which is the equivalent of joining all rows onto all other rows as there aren't any rows that are equal to each other. 



As a result we our rows of data grow massively and we have 400 days (instead of 20). Therefore we need to filter out the results that we no longer need. In this case we use another contains calculation to remove any fields where the Name is not in the Answer Smash field: 

CONTAINS([Answer Smash],[Name])

After the last filter, we are now ready to output our data which should look like this: 



Here's our full output for comparison. 

After you finish the challenge make sure to fill in the participation tracker, then share your solution on Twitter using #PreppinData and tagging @Datajedininja@JennyMartinDS14 & @TomProwse1

You can also post your solution on the Tableau Forum where we have a Preppin' Data community page. Post your solutions and ask questions if you need any help! 


Popular posts from this blog

2023: Week 1 The Data Source Bank

2023: Week 2 - International Bank Account Numbers

How to...Handle Free Text