This example is inspired by a customer who distinguished their Snowflake tables into two groups:
For the second group they made sure the Snowflake table comment for those tables included the text intraday=true
.
This allowed database clients, including Excel models, to implement faster and cheaper queries by refreshing all queries — one time — at the start of the day, and subsequently only running queries that hit intraday=true
tables.
The code snippet below shows how to do this using optimal(xl)'s VBA API:
Public Sub RefreshIntradayData() |
In the code samples that accompany our embedded API, we improve this macro by ensuring that at least one full refresh takes place, each new day, before we restrict the refresh to intraday=true
tables. We also enhance it to add perpetual refreshes every 30 seconds; publish a 'dashboard' sheet as a website for teammates to view; and save/upsert some of the Excel model's computations to a Snowflake table.