We move into our first intermediate month challenge this week, and we are looking at extending the functionality of Tableau Prep by introducing analytical calculations. If you are a Tableau Desktop user then you will be familiar with Level of Detail (LOD) calculations and we'll utilise these to make the end user's life a little easier by doing a couple of calculations for them.
Step 1 - Bank Code & Month Name
First we need to extract the Bank from the Transaction Code field. From the requirements we know that the letters within Transaction Code make up the Bank field, therefore we can use a custom split to extract anything before the first '-':
From here we can rename the new field 'Bank':
We can also extract the month name from the Date field. Again, we can use the in-built functionality within Tableau Prep to help us out here. From the Transaction Date, we can choose Convert Date and select Month Name
After this our table should now look like this:
Step 2 - Total & Rank
The next step that we need to do is calculate the total transaction values per bank and month. To do this we can use an aggregate step where we group by Transaction Date and Bank, then Sum the Value field:
Now we have the total for each month and bank combination we can rank each bank on their transaction values each month vs other banks.
This is where we can use our first analytics calculation in the form of a Ranking.
You can write out the Rank function within a calculated field by utilising the partition and order by, but you can also use the ui to help out.
From here we can group by Transaction Date, then rank the Value in a descending order:
This will create the ranking for us and our table should look like this:
Step 3 - Monthly and Bank Averages
Finally, we want to calculate the average rank per bank and the average transaction value per bank without losing all of the other data. Normally, we would use an aggregation to do this, however this would limit the detail within our view and we don't want that... This is where LODs come in!
We want to create an LOD for each Avg calculation that we require, and this can be done by typing out into a calculated field (similar to Tableau Desktop) or use the ui like we did with the rank above:
Avg Rank per Bank
Avg Transaction Value per Rank
These two calculations give us the two averages that we require, and you'll notice that these have been created whilst maintaining the original level of detail.
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!
Challenge by: Jenny Martin As I've mentioned before in a previous challenge, I'm a big fan of a quiz show called Richard Osman's House of Games. However, I've often found the way that they decide the overall winner of the week a little troubling. Each day the player who has scored the most, will receive 4 points, 2nd place will receive 3 points, 3rd place will receive 2 points and last place will receive one point. These points will be added up across the week to determine the overall winner, but with a twist! Each Friday double points are awarded so 1st place receives 8 points and so on. This leads me to wondering: Would there be a different winner if there was no double points Friday? What about if participants weren't ranked at the end of each day and they had a running total score across the week instead, would that lead to a different winner? What about doubling the scores on the Friday, instead of the points awarded? Input Luckily I didn't have to collect ...
Free isn't always a good thing. In data, Free text is the example to state when proving that statements correct. However, lots of benefit can be gained from understanding data that has been entered in Free Text fields. What do we mean by Free Text? Free Text is the string based data that comes from allowing people to type answers in to systems and forms. The resulting data is normally stored within one column, with one answer per cell. As Free Text means the answer could be anything, this is what you get - absolutely anything. From expletives to slang, the words you will find in the data may be a challenge to interpret but the text is the closest way to collect the voice of your customer / employee. The Free Text field is likely to contain long, rambling sentences that can simply be analysed. If you count these fields, you are likely to have one of each entry each. Therefore, simply counting the entries will not provide anything meaningful to your analysis. The value is in ...
Created by: Carl Allchin Welcome to a New Year of Preppin' Data challenges. For anyone new to the challenges then let us give you an overview how the weekly challenge works. Each Wednesday the Preppin' crew (Jenny, myself or a guest contributor) drop a data set(s) that requires some reshaping and/or cleaning to get it ready for analysis. You can use any tool or language you want to do the reshaping (we build the challenges in Tableau Prep but love seeing different tools being learnt / tried). Share your solution on LinkedIn, Twitter/X, GitHub or the Tableau Forums Fill out our tracker so you can monitor your progress and involvement The following Tuesday we will post a written solution in Tableau Prep (thanks Tom) and a video walkthrough too (thanks Jenny) As with each January for the last few years, we'll set a number of challenges aimed at beginners. This is a great way to learn a number of fundamental data preparation skills or a chance to learn a new tool — New Year...