Free Trial

Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #460: Fun Facts About LEGO® Sets! Part 2

AYXAcademy
Alteryx
Alteryx

Weekly Challenge LMS Banner.png

Hello Community members!

 

A solution to last week’s challenge can be found here.

 

Once again, thank you, @Qiu , for this fun challenge!

 

Last week, in challenge 459, you determined which LEGO® set contains the largest number of parts, identified the theme with the largest number of sets, and calculated the average number of parts per set for each year. Now, it is time to switch gears and perform an in-depth analysis on one of the most legendary LEGO sets of all time, the Taj Mahal set!

 

In this challenge, your task is to determine how many other LEGO sets you can build using only the parts from the Taj Majal set (number 10189-1). Note: A set is considered "buildable" from the Taj Mahal set if the part numbers and colors match.

To complete this challenge, you are provided with three datasets.

 

Datasets:

  • sets.csv: Contains information on LEGO sets, including a unique set number, name, release year, theme ID, part count, and image URL.
  • inventories.csv: Lists the inventories for each LEGO set, which include a set ID, its version, and the set number.
  • inventory_parts.csv: Details the parts for each inventory, including part number, color, quantity, and whether it is a spare part.

 

Note: If you get stuck, there is a hints box in the workflow that will help you solve the challenge.

 

Let the building begin! Good luck!

 

The Academy Team

 

Download Start File

 

Download Solution File

 

Data Sources:

https://rebrickable.com/downloads/

https://www.kaggle.com/code/andycapp29/best-bang-for-your-buck-lego-dataset-analysis/notebook

TheOC
15 - Aurora
15 - Aurora

Nice little challenge - I especially like that there few a few traps in there that were easy to fall into.

 

Spoiler
Classic case of using a "join as a filter" throughout. 

Unfortunately, the Community still doesn't let me attach photos.

 

 


Bulien
griffinwelsh
12 - Quasar

I believe the number of sets in the expected output is an wrong. The issue seems to be that you are finding the completable inventories and then joining those to get the set numbers, but some sets contain more than one inventory. I did a join with the sets in the expected output to show which parts are missing from the 10 improper matches.

ggruccio
ACE Emeritus
ACE Emeritus

Solved, but I was off by one - I've looked at the detail...

 

Spoiler
Set 519-1 asks for 30 of part 3021 in color 14, but the Taj Mahal set only includes 4 in that color.Screenshot 2025-01-21 103338.png
Bobbyt23
12 - Quasar

Fun challenge. I get the right quantity in the output but 2 of mine are different to the answer. Think it may be to do with part versions on some of them.🤔

Spoiler
image.png
griffinwelsh
12 - Quasar

@TheOC If you join the L and J anchors from your final join on set number you will find that you have 10 set numbers that were present in both indicating there are inventory ids contained within these 10 sets that are not buildable with the pieces from the Taj Majal set.

Spoiler

CW6004.jpg
EdenTP
8 - Asteroid
Spoiler
image.png
Kenda
16 - Nebula
16 - Nebula
Spoiler
image.png
Kenda
16 - Nebula
16 - Nebula

@TheOC wrote:

Nice little challenge - I especially like that there few a few traps in there that were easy to fall into.

 

Spoiler
Classic case of using a "join as a filter" throughout. 

Unfortunately, the Community still doesn't let me attach photos.

 

 


 

If you click the Camera button

image.png

then click into that window that pops up, you can then use Ctrl + V to paste an image onto your post.

balajilolla2
10 - Fireball
Spoiler
Solution Attached

Screenshot 2025-01-21 092642.jpg