google-site-verification=EmVnnySXehAfTr_j8ZJN48hwvxJtfNf80pkPX1ObQlA Fast Track News: 50 Creating a Looker Modeled Query and Working with Quick Start

50 Creating a Looker Modeled Query and Working with Quick Start

 



connection: "bigquery_public_data_looker"


# include all the views

include: "/views/*.view"

include: "/z_tests/*.lkml"

include: "/**/*.dashboard"


datagroup: training_ecommerce_default_datagroup {

  # sql_trigger: SELECT MAX(id) FROM etl_log;;

  max_cache_age: "1 hour"

}


persist_with: training_ecommerce_default_datagroup


label: "E-Commerce Training"


explore: order_items {

  join: users {

    type: left_outer

    sql_on: ${order_items.user_id} = ${users.id} ;;

    relationship: many_to_one

  }


  join: inventory_items {

    type: left_outer

    sql_on: ${order_items.inventory_item_id} = ${inventory_items.id} ;;

    relationship: many_to_one

  }


  join: products {

    type: left_outer

    sql_on: ${inventory_items.product_id} = ${products.id} ;;

    relationship: many_to_one

  }


  join: distribution_centers {

    type: left_outer

    sql_on: ${products.distribution_center_id} = ${distribution_centers.id} ;;

    relationship: many_to_one

  }

}


# Place in `training_ecommerce` model

explore: +order_items {

  query: start_from_here{

      dimensions: [products.department, users.state]

      measures: [order_count, users.count]

      filters: [users.country: "USA"]

    }

}



explore: events {

  join: event_session_facts {

    type: left_outer

    sql_on: ${events.session_id} = ${event_session_facts.session_id} ;;

    relationship: many_to_one

  }

  join: event_session_funnel {

    type: left_outer

    sql_on: ${events.session_id} = ${event_session_funnel.session_id} ;;

    relationship: many_to_one

  }

  join: users {

    type: left_outer

    sql_on: ${events.user_id} = ${users.id} ;;

    relationship: many_to_one

  }

}


No comments:

Post a Comment

April Week 2 || Lab 2 || Troubleshooting Data Models in Looker

  CREATE NEW FILE NAME: user_order_lifetime view: user_order_lifetime { derived_table: { sql: SELECT order_items.user_id as us...