Quettabyte
Gist | Mastodon | Threads
Level of Detail in Snowflake Semantic Views
SQL
/* Level of Detail example
store_sales.regional_sales 
  AS sum(total_sales)
    OVER (PARTITION BY 
      EXCLUDING 
        transactions.store_name) 
*/


CREATE OR REPLACE SEMANTIC VIEW 
  level_of_detail_example
  DIMENSIONS (
    store.store_name
    , store.region
    , transactions.tran_date
  )
  METRICS (
    transactions.total_sales
      AS sum(selling_price)
    , transactions.regional_sales 
      AS sum(total_sales)
        OVER (PARTITION BY 
                EXCLUDING 
                  store.store_name) 
  );
Created on Fri, 28 Aug 2026 04:11:08 +0000 | URL: https://quettabyte.net/gist.php?id=Azd4e

Code screenshot

Level of Detail in Snowflake Semantic Views - Pinterest Image

« Create Another Gist