view: facts_prod_apple_podcasts_sales_summary { sql_table_name: FACTS.PROD.APPLE_PODCASTS_SALES_SUMMARY ;; dimension_group: report_start_date { view_label: "Date" description: "Refers to the reporting date that the report was initially generated by Apple" label: "Report Start" type: time sql: ${TABLE}.report_start_date ;; timeframes: [year, quarter, month, week, date, day_of_year, day_of_week, week_of_year, month_name, month_num ] } dimension_group: report_end_date { view_label: "Date" label: "Report End" description: "Last date of the specified reporting period. This will be the same as Report Start Date for Daily reports" type: time sql: ${TABLE}.report_end_date ;; timeframes: [year, quarter, month, week, date, day_of_year, day_of_week, week_of_year, month_name, month_num ] } dimension: storefront_name { type: string description: "Territory in which the Podcast was consumed" sql: ${TABLE}.storefront_name ;; } dimension: channel_apple_id { type: string description: "The unique string which Apple uses to label a podcast channel" sql: ${TABLE}.channel_apple_id ;; value_format: "0" } dimension: channel_name { type: string description: "Sony designated name for the channel" sql: ${TABLE}.channel_name ;; } dimension: apple_identifier { type: number description: "The unique Apple identifier for the given subscription" sql: ${TABLE}.apple_identifier ;; value_format: "0" } dimension: channel_subscription { type: string description: "The name of the subscription provided by Sony during its creation." sql: ${TABLE}.channel_subscription ;; } dimension: device { type: string description: "The type of device where the event occurred" sql: ${TABLE}.device ;; } dimension: sale_refund { type: string description: "Indicates if a transaction is a sale or return. Ex: S = Sale, R = Refund" sql: ${TABLE}.sale_refund ;; } measure: customer_price { type: sum description: "Price charged to the customer. Negative values indicate refunds." sql: ${TABLE}.customer_price ;; value_format: "#,##0.00" } dimension: customer_currency { type: string description: "Customer’s currency" sql: ${TABLE}.customer_currency ;; } dimension: currency_of_proceeds { type: string description: "Currency of Sony proceeds" sql: ${TABLE}.currency_of_proceeds ;; } measure: developer_proceeds { type: sum description: "The per-unit proceeds for each item delivered" sql: ${TABLE}.developer_proceeds ;; value_format: "#,##0.00" } measure: units { type: sum description: "The aggregate number of units sold. Negative values indicate refunds" sql: ${TABLE}.units ;; } measure: sony_proceeds { type: number description: "Developers proceeds * Units" sql: sum(${TABLE}.developer_proceeds) * sum(${TABLE}.units) ;; label: "Sony Proceeds" value_format: "#,##0.00" } dimension_group: download_date { view_label: "Date" description: "Refers to when the report was downloaded from Apple Podcasts Connect" label: "Download" type: time sql: ${TABLE}.download_date ;; timeframes: [year, quarter, month, week, date, day_of_year, day_of_week, week_of_year, month_name, month_num ] } }