Connect Tableau Desktop to Athena and handle tables with struct columns and date split into year, month, and day

monitoringaws

Tableau is a BI tool that can connect to various data sources such as local files and BigQuery, visualize and analyze easily by dragging columns.

Adding trends and forecasts,

you can also create and share stories for presentations and dashboards.

Pricing is $75/month for Creator, which allows connecting to data sources and creating workbooks, while Viewer, which is for viewing only, is $15/month. There’s also a free version called Tableau Desktop Public Edition, but it doesn’t allow internal sharing via Tableau Server and has limitations on data sources.

Connection to Athena can be added by downloading the driver, placing it in the specified directory, and entering the following connection information.

The table has the date split into Year, Month, and Day, and the Value is in struct format.

Regarding the date, I succeeded to convert it to a Date format by processing it in a Calculated Field as follows.

On the other hand, handling structs seems challenging, and when Split is used, a Calculated Field like this is created. It’s quite a unstable approach. I think it’s probably intended to be preprocessed with Prep Builder.

TRIM( SPLIT( SPLIT( SPLIT( SPLIT( [Value], "{", 2 ), "score", 2 ), "=", 2 ), ",", 1 ) )

Therefore, I decided to process it using Custom SQL.

As a result, I was able to visualize the score in a time series.