iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📊

Trying Out Tableau Multi-Fact Analysis with Snowflake

に公開

Hello. This is Tamai, an apprentice Customer Success Manager.

Tableau version 2024.2 has been released, and one of the new features in this version is "Multi-fact Analysis."
https://help.tableau.com/v0.0/pro/desktop/en-us/datasource_mfr_multiple_base_tables.htm
This feature might not immediately ring a bell for those who don't frequently work with data warehouses (DWH). Also, some might not have an environment to test it even if they understand it.

Therefore, in this article, I would like to actually try out the Multi-fact Analysis feature.

About Multi-fact Analysis

Rather than me explaining it again, Takuman has already provided an excellent explanation in the following article, so please check that out.
https://zenn.dev/churadata/articles/70cabec35abea6#1.-shared-dimension
In short, it means "you can now join multiple dimension tables to multiple fact tables." As mentioned in the article above, this feature truly shows its value when the underlying data source (DB or DWH) utilizes dimensional modeling (such as star schema or snowflake schema).
If I were to say it boldly, I don't think this feature is as powerful for local data like Excel or CSV (personally, I haven't seen cases where files or sheets are separated following dimensional modeling practices in Excel, etc.).

Trying it out

So, what happens when we connect Tableau Desktop 2024.2 to data that is actually dimensionally modeled? Let's take a look.

Environment

  • Snowflake
    • Enterprise Edition
  • Tableau Desktop
    • 2024.2.1 Apple Silicon

Data to use

Sample Data: TPC-DS
This is a dataset commonly used for measuring DWH performance. It is included in Snowflake by default (which is convenient).

"TPC-DS models the decision support functions of a retail product supplier. The supporting schema includes critical business information such as customer, order, and product data."

By the way, the official documentation states:

The TPC-DS schema is a snowflake schema. It consists of multiple dimension and fact tables.

Now, what exactly is a snowflake schema...?

A snowflake schema is a multi-dimensional data model that is an extension of a star schema, where dimension tables are broken down into sub-dimension tables. Snowflake schemas are commonly used in data warehouses, data marts, and relational databases for BI (Business Intelligence) and reporting using multi-dimensional analysis.
Source: https://www.databricks.com/glossary/snowflake-schema

In short, it is the perfect data source for testing this Multi-fact Analysis (to put it simply).

Trying it out with Tableau Desktop 2024.2

So, I actually connected to Snowflake's TPC-DS and performed a simple join as shown below.

I joined the date table (DATE_DIM) and the item table (ITEM) to each sales table (Web, Store, Catalog).
If I were to add annotations to the image above, it would look like this:

The dimension tables (DATE_DIM and ITEM) are each joined to multiple fact tables (on the left side of the image). This is the feature that is now possible with this Multi-fact Analysis.
When you want to analyze across different "facts of sales" using a "date perspective (dimension)," if your tables are modeled in a star or snowflake schema, you can achieve this by reusing and joining a single date table to each fact table as shown above (I will explain why this method is good later).

Note: This is a very rough Viz, but it analyzes three fact tables across dates.

In Previous Versions

At this point, you might be thinking, "Wait, couldn't we do this before?" (To be honest, that was my first thought too). So, I tried to do the same thing in the previous version (2024.1).
In conclusion, it is not possible.

It's hard to tell from the screenshot, but this is a shot of me trying to join DATE_DIM to WEB_SALES as well, but being completely unable to drag it. The UI itself is built on the premise that "there is always only one fact table!" In short, Multi-fact Analysis was definitely not supported in versions older than 2024.2.
By the way, if you try to open a workbook that uses Multi-fact Analysis in an older version, this happens:

When Not Using Multi-fact Analysis (≒ Not Adopting Dimensional Modeling)

Now that we've very briefly tried out the Multi-fact Analysis feature, many of you might still be wondering, "Does this actually help in the real world?"
I'd like to share some of my personal thoughts by looking at it from the opposite perspective: "What happens if we don't use Multi-fact Analysis?"

Pattern of Creating a Dedicated Data Mart (Wide Table)

If you were to try analyzing multiple fact tables by various dimensions, as we did this time, without using Multi-fact Analysis, the first thing that comes to mind is "joining everything on the DWH side beforehand (creating a wide table)."
Multi-fact Analysis is strictly a feature of Tableau Desktop, and "joining multiple fact tables and multiple dimension tables" itself can be done on the DWH side (using SQL). So, the idea is to create a pre-joined wide table on the DWH side and then reference that table from Tableau Desktop.
While this method is not inherently bad, you need to be quite serious about managing these wide tables if you choose to go this route.
If a new wide table (or any data mart) has to be created on the DWH side every time there's a request from a Tableau Desktop user, the workload for the person working on the DWH side simply increases. Even if the Tableau Desktop user also works on the DWH, continuing this practice will lead to a proliferation of similar tables (or views) in the DWH, causing governance to crumble.
In that case, it might be more peaceful to only prepare properly dimensionally modeled tables, such as star schemas, in the DWH and handle the rest on the Tableau Desktop side.

Pattern of Using Custom SQL

Some of you might think, "If it's better to keep things on the Tableau Desktop side as much as possible, I'll just write the join logic in Custom SQL."
However, personally, I believe Custom SQL should be avoided until the very last resort (regardless of this specific requirement). Since all the requirements and business logic contained within the SQL become confined within the Tableau workbook, transparency across the entire data analysis platform is lost, and the maintainability of the workbook significantly deteriorates (e.g., needing to heavily modify the SQL just to make a small change to a Viz).
Custom SQL should only be used in extremely special cases, and it's desirable to connect to data using Tableau's native features. Considering that, I wouldn't recommend this pattern either.

Others

Rather than just Multi-fact Analysis, the following article provides a good reference for the benefits of dimensional modeling itself.
https://zenn.dev/ryotas_data/articles/34624130412e14

Conclusion

As I mentioned at the beginning, I don't believe Multi-fact Analysis is as powerful for local file analysis.
I hope this feature serves as a catalyst for DWH and dimensional modeling to become more widely adopted.

Discussion