In the world of data analytics, metadata is the unsung hero that provides clarity and context to the seemingly chaotic world of data. Imagine metadata as a map that not only guides us through the intricate web of data connections but also highlights the hidden stories woven into our datasets. In this blog post, we embark on a journey into the world of Tableau Metadata, exploring its significance, capabilities, and how it empowers users to unravel the stories hidden within their datasets by extracting Tableau Metadata using GraphiQL.
What is Tableau Metadata?
Tableau Metadata is data about Tableau content. It gives users a thorough understanding of the relationships, structure, and features of your datasets and helps them understand how Tableau organises and uses data.
Why is Tableau Metadata Important?
Effective data governance and well-informed decision-making are built on Tableau Metadata. Providing insight into the lineage, quality, and usage of data enables users to make informed decisions about their analyses and visualisations.
Key Types of Tableau Metadata
- Data source Metadata: Tableau can capture metadata at the level of the data source, including information on fields, relationships, and connection details. Users can examine the metadata to learn about the schema, data types, and any calculated fields connected to the source.
- Workbook Metadata: Workbook metadata overviews the dashboards, visualisations, and underlying data connections. Understanding workbook metadata is essential for consistency across analysis, version control, and teamwork.
- User Metadata:
- User Roles and Permissions: Information on user roles (e.g., Viewer, Explorer, Creator) and their access permissions to different parts of the Tableau environment.
- User Preferences: Settings related to user-specific configurations, such as default views or preferences.
- Data Quality Metadata:
- Data Integrity: Metadata related to the quality and accuracy of the data, including data validation rules or flags for missing or erroneous data.
- Data Refresh Schedule: Information about how frequently data extracts are refreshed or updated.
- Project Metadata: This metadata helps manage, organise, and track content within a project. Key aspects of project metadata include:
- Project Name and Description: The name of the project, which serves as an identifier and helps in organising and locating it within the Tableau environment. The description provides information on the project’s purpose or content, providing context for users.
- Project Hierarchy – Parent and Child Projects: Information on whether the project is a top-level project or a sub-project within another project. This hierarchy helps in organising and structuring content.
Practical Applications of Tableau Metadata API:
There are several potential applications where Metadata API can be used such as:
- Creating an Internal Data Dictionary: Building a catalog of data sources for easy reference.
- Avoiding Calculation Duplication: Ensure calculations are unique and follow proper naming convention.
- Tracking Data Lineage: Understand how data sources, workbooks and calculations are interconnected.
Accessing the Tableau Metadata API using GraphiQL
The Tableau server comes with the Metadata API installed, but it is by default disabled.
A server admin must enable the Metadata API on Tableau Server using the tsm maintenance metadata-services enable command through the Tableau Services Manager (TSM) command line interface (CLI). For more information, see tsm maintenance topic in the Tableau Server Help.
You can access the GraphiQL through:
https://<your-tableau-server>/metadata/graphiql
GraphiQL query syntax
Before we begin to query the API, we need to understand which elements should be included in the query.
The sample code provided below illustrates this: we must name a query, indicate the object we want to access(for example, ‘tableauUsers’), and the relevant attributes of this object (for example, ‘username’). Certain objects (like user-owned workbooks) can have attributes of other objects at the same time. In this instance, a new pair of curly brackets must be used to nest the “ownedWorkbooks” object characteristics.
Case Study – Impact Analysis on a Decommissioned Table
Problem Statement
For the purposes of my problem, I was connecting to the Metadata API of my Tableau Server to do Impact Analysis. A certain table from a database was getting decommissioned, and I had to analyse its impact on the workbooks, such as, how many workbooks are affected after the table is decommissioned, how many fields are coming from that table, and how much effort and time is required to repoint all workbooks to the new table.
Solution
The Below query in Figure 1 will return the all the Workbooks connected to the Sample Superstore Datasource as shown in Figure 2, it also shows the Upstream tables used to build the data source and the fields in the DataSource. We can use the fields to do the One-to-one mapping for the old and new TDS.
Digging into metadata at the field level provides statistics and distributions, offering insights into data patterns, outliers, and potential areas for deeper analysis. This level of detail will help create new Data Sources and show the impact of replacing the old ones.
Extract Refresh History: For Tableau extracts, metadata includes a refresh history that details when and how extracts were updated. This information is vital for maintaining data refresh and ensuring that visualisations reflect the latest data. This information can be achieved through hasExtracts object.
Conclusion
As we journey through the world of metadata within Tableau, several key takeaways emerge, shaping the way we understand, govern, and derive insights from our data.
Efficient Collaboration:
Metadata plays a pivotal role in fostering efficient collaboration within organisations. Whether at the data source or workbook level, metadata serves as a reference point, enabling teams to work cohesively, maintain version control, and ensure consistency across analyses.
Quality Assurance:
The lineage and impact analysis capabilities of Tableau Metadata contribute significantly to data quality assurance. Users can trace the journey of data, identify potential issues, and ensure that changes to data sources or fields are understood and validated throughout the organisation.
Optimising Data Resources:
Metadata equips organisations with the tools to optimise data resources. Usage statistics, extract refresh history, and field-level details enable efficient resource allocation, ensuring that data remains fresh, relevant, and aligned with organisational goals.
Tableau Metadata is a powerful ally in the ever-changing world of data analytics, helping users navigate datasets and visualisations. Understanding Metadata enables organisations to build strong data governance and extract the most out of the data.
Discover how Skillfield can help you leverage Tableau Metadata to enhance your data governance and extract the most out of your data. Contact us today to learn more and schedule a consultation.
Author: Sanket Natekar