![]() ![]() To determine the total number of Wins for each team I createdįIXED : SUM(IF = ‘W’ THEN 1 ELSE 0 END)}Īnd then repeated this similarly to get a Losses and Ties measure.įinally I determined the total number of games each team played by using the provided tablename (count) field that is now added in more recent versions of v2020 (supersedes the Number of Records field). So this field indicates whether the Team in each row won, lost or drew (tied) the match.įrom this we can then work out the points the Team gained in the match. IF = ‘Home Team’ AND FTR = ‘H’ THEN ‘W’ĮLSEIF = ‘Away Team’ AND FTR = ‘A’ THEN ‘W’įTR in the data set stands for full-time result and indicated whether it was the Home (H) or the Away (A) team that won, or whether it was a Draw (D). ![]() With the data structured this way it was very simple to calculate the various measures required : I then simply renamed Pivot Field Names to Home or Away and Pivot Field Values to Team. This has the effect of duplicating the rows of data and adding 2 additional columns to the end Pivot Field Names containing the column names that had been pivoted, and Pivot Field Values containing the values of those fields. After connecting to the data, highlight the columns Home Team and Away Team, right click and select Pivot. I did this in Tableau itself, in the data source pane. Given Luke had suggested a ‘trick’, I decided I was going to pivot the data to expand the data to give me 1 row per game per team, hoping this was the ‘trick’ he implied, and there was no requirement to state that data modelling wasn’t allowed. Trying to count the number of games a specific team played was likely to be complicated in this format. I looked at the data referenced to get a feel of the shape and layout – it showed 1 row per game, with the home & away team for each game stored in different columns. The Latest Challenges page indicated they’d be table calculations involvedĪnd Luke’s tweet introducing the challenge suggested there was a ‘trick’ that would make this a lot simpler to solve…. This challenge had no real restrictions, and there were minimal clues. Sometimes the #WOW challenges are set with a very specific direction in mind eg no LODs, use 1 sheet only, no data modelling etc. Getting the data for the Last 5 matches chart tooltip.It was nice to see an English sport that I’m very familiar with feature, even if I had to keep retyping the word ‘Draw’ for ‘Tie’ □ Luke provided this fun challenge this week.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |