2024: Week 32 - Pokémon Card Organising

Challenge by: Jenny Martin

I recently got back into Pokémon card collecting, which not only involves collecting new sets, but also going through old sets I had as a child and organising those. For this challenge we'll be focusing on 2 really cool old sets: Gym Heroes and Gym Challenge. They contain cards of Pokémon that belong to particular gym leaders in the Kanto region, such as Blaine's Vulpix, one of my personal favourites:

Image taken from Pokéllector

Now, traditionally, you would organise cards using the number in the bottom right corner e.g. 65/132 in the above example. But for these sets, I wanted to organise them all:
  • based on which gym leader they belong to
  • in the order of the Kanto gyms 
  • with the Gym Leader card first
  • followed by their Gym card
  • followed by the remaining Trainer cards associated with them (in card number order)
  • followed by their Pokémon in Pokédex order
  • using the Pokémon level in the bottom left corner of the card, where a leader has multiple of the same Pokémon
  • with leftover trainer cards not associated with a leader at the end (in card number order, with the Gym Heroes set coming before the Gym Challenge set where there are ties)
You can see why I turned to Tableau Prep to implement this logic! It got quite confusing trying to do it by hand - particularly when I don't own all the cards for these sets. Yet! 

Inputs

We're using a couple of inputs this week. Luckily there's a Pokémon Trading Card Game API that we've pulled most of the data from, as well as using Bulbapedia to get information about the Pokédex number.
  1. Trainer Cards 

  2. Pokémon Cards 

  3. Leader Order 

  4. Pokémon Input 

Requirements

  • Input the data
  • For the Pokémon Cards Input, separate the Gym Leader and Pokémon
    • e.g. Blaine's Vulpix becomes Blaine and Vulpix in separate fields
  • Use the Pokémon Input to bring in information about the Pokédex Number
    • Make sure not to duplicate any rows
  • Combine with the Trainer Cards Input
  • Use the Table Names field to identify the Card Type, either Pokémon or Trainer
  • Any rows that do not have a Leader, assign as "Leftover Trainers"
  • Combine with the Leader Order Input
  • Based on the above description, find a way to sort the cards into the correct order
  • Remove unnecessary fields
  • Output the data

Output


  • 6 fields
    • Sort Order
    • Leader
    • Gym Set
    • Number
    • Card
    • Card Type
  • 252 rows (253 including headers)

You can view the output here.

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

2024: Week 1 - Prep Air's Flow Card

How to...Handle Free Text