Streamlit Hierarchical Data Viewer in Snowflake

Cristian Scutaru
5 min readFeb 4, 2024
Employee-Manager hierarchy, with nodes grouped by Job titles

When I described How to Easily Visualize Hierarchical Tabular Data, Streamlit Apps in Snowflake was not in Public Preview, as it is now. My demo was on a CSV file, but here is a more evolved open-source version that installs my code as a Streamlit App in your Snowflake account, and generates graphs on hierarchical data returned in a query result.

Read here the post for free if you do not have a Medium subscription.

The SQL Query

When you run the app, a default SQL query will automatically run on an Employee sample table, installed in the same schema with the application:

Query with DataFrame result, used as source for the graph generation

You must now select returned column names in the left sidebar, and switch to the Graph tab, to see the generated charts.

The query will not change and execute again, until you change the statement (you may query your own data, from anywhere in the Snowflake account!) and click Run. We decorated that function with the st.cache_resource Streamlit…

--

--

Cristian Scutaru
Cristian Scutaru

Written by Cristian Scutaru

World-class expert in Snowflake Data Cloud. Former Snowflake "Data Superhero". SnowPro SME (Subject Matter Expert). 5x SnowPro certification exams.

Responses (2)