view: orchard_app_reporting_v2_prod_ows_track_ows_track_performer { sql_table_name: ORCHARD_APP_REPORTING_V2.PROD_OWS_TRACK_OWS_TRACK.PERFORMER ;; # dimension: Performer_Id { type: number sql: ${TABLE}.PERFORMER_ID ;; } dimension: Performer_role_id { type: number sql: ${TABLE}.PERFORMER_ROLE_ID ;; hidden: yes } dimension: Performer_Type { type: string sql: ${TABLE}.PERFORMER_TYPE ;; } dimension: Performer_Name { type: string sql: ${TABLE}.BIRTH_NAME ;; } dimension: tuid { type: number sql: ${TABLE}.UNIQUE_TRACK_ID;; hidden: yes } # dimension: lifetime_orders { # description: "The total number of orders for each user" # type: number # sql: ${TABLE}.lifetime_orders ;; # } # # dimension_group: most_recent_purchase { # description: "The date when each user last ordered" # type: time # timeframes: [date, week, month, year] # sql: ${TABLE}.most_recent_purchase_at ;; # } # # measure: total_lifetime_orders { # description: "Use this for counting lifetime orders across many users" # type: sum # sql: ${lifetime_orders} ;; # } } # view: orchard_app_reporting_v2_prod_ows_track_ows_track_performer { # # Or, you could make this view a derived table, like this: # derived_table: { # sql: SELECT # user_id as user_id # , COUNT(*) as lifetime_orders # , MAX(orders.created_at) as most_recent_purchase_at # FROM orders # GROUP BY user_id # ;; # } # # # Define your dimensions and measures here, like this: # dimension: user_id { # description: "Unique ID for each user that has ordered" # type: number # sql: ${TABLE}.user_id ;; # } # # dimension: lifetime_orders { # description: "The total number of orders for each user" # type: number # sql: ${TABLE}.lifetime_orders ;; # } # # dimension_group: most_recent_purchase { # description: "The date when each user last ordered" # type: time # timeframes: [date, week, month, year] # sql: ${TABLE}.most_recent_purchase_at ;; # } # # measure: total_lifetime_orders { # description: "Use this for counting lifetime orders across many users" # type: sum # sql: ${lifetime_orders} ;; # } # }