This blog is based on Maven Analytics’ data set LEGO sets, Free Sample Dataset Download – LEGO Sets – Maven Analytics | Build Data Skills, Faster thanks for Maven Analytics for publishing this data set.
The questions published are here:
- How many LEGO sets have been released since 1970? Is there a noticable trend?
2. Is there a relationship between the price of a set and its number of pieces?
3. Which has been the most popular theme in each decade?
4. Are LEGO minifigures most closely tied to licensed sets?
I will answer the questions based on the sample data at the end of this blog post.
First we need to download the data.
I took data – text to columns.

Data looks like this in Excel.

I downloaded the data into Access.
Set_ID was marked as indexed and I changed manually set_id into short text data type and not to be indexed. I changed decimal symbol to dot.
The data is in the Access and I will make a Power Pivot in Excel based on the Access table. As stated earlier, once data is in Access, I can query data with SQL.
- How many LEGO sets have been released since 1970? Is there a noticeable trend?
Totally 18457 Lego sets have been released.
I checked with SQL that values are unique.
SELECT DISTINCT
Count(set_id)
FROM
LS2;

Results in Access.

This is the same result from Excel power pivot.
How many Legosets have been released annually, that we can find out with this SQL query:
SELECT
YEAR,
COUNT(YEAR)
FROM
Lego_sets
GROUP BY
year;

Results are not very readable, as the list so long.

We can take the report via Power Pivot and create a graph of the results.

We can see a clear increasing trend is visible, especially starting from year 1990.
2. Is there a relationship between the price of a set and its number of pieces?
Not all the fields in have values in pieces are retail value fields. I have taken only the records that both the fields have values, 5321 records altogether.

This correlation is counted from Excel.
A value close to 0,9 is very clear positive correlation. The more pieces in a Lego set, the more expensive the Lego set is.
3. Which has been the most popular theme in each decade?
I added a new column in the Excel to define the decades. Years 1970-1979 belong to 1970s.

The sentence is simply: =ROUNDDOWN(C2;-1). That is rounding down to full ten.

This is a pivot table by theme group and decade.
To find it easily which is the highest value per decade, we could use conditional formatting.

More rules.

Format only top or bottom ranked values, then select top 1. Only the highest value will be formatted. Press format.

The highest value will be formatted with yellow filling.

When you have created the rule, you can just select manage rules.

2000s, 2010s and 2020s the miscellaneous is the most popular theme group. Normally, miscellaneous should be an additional group not a major group. Could the grouping be made differently ?
1970s: vintage
1980s: modern day
1990s: pre-school
2000s: miscellaneous
2010s: miscellaneous
2020s: miscellaneous
4. Are LEGO minifigures most closely tied to licensed sets?
Licensed is a theme group.

A pivot table was created theme group in rows and minifigs in values.
The Licensed theme group is the mostly tied to mini figures.

We have the same results with Access.
This is the SQL query in Access.
SELECT
themeGroup,
COUNT(minifigs)
FROM
LS2
GROUP BY
themeGroup
ORDER BY
COUNT(minifigs) DESC;
Here are my answers in short:
- How many LEGO sets have been released since 1970? Is there a noticable trend?
18457, there is a clear increasing trend.
2. Is there a relationship between the price of a set and its number of pieces?
Yes, there is a clear positive correlation.
3. Which has been the most popular theme in each decade?
1970s: vintage
1980s: modern day
1990s: pre-school
2000s: miscellaneous
2010s: miscellaneous
2020s: miscellaneous
4. Are LEGO minifigures most closely tied to licensed sets?
Yes.




