# Because of the transition to Abacus, on July 2025 the original ACCT_PERIOD table became deprecated. # The drop-in replacement table is STATEMENT_PERIOD. # We keep the original view name (orch_app_ar_acct_period) so to not break any end user reports, dashboards, etc. view: orch_app_ar_acct_period { sql_table_name: "ORCHARD_APP_REPORTING_V2"."PROD_ROYALTY_ACCOUNTING_ROYALTY_ACCOUNTING"."STATEMENT_PERIOD" ;; dimension: id { view_label: "Accounting Period" label: "Period ID" type: number sql: ${TABLE}.STATEMENT_PERIOD_ID ;; } dimension: Year { label: "Year" type: number hidden: yes sql: ${TABLE}.STATEMENT_YEAR ;; } dimension: Quarter { label: "Quarter" type: number hidden: yes sql: CEIL(${TABLE}.STATEMENT_MONTH / 3.0) ;; } dimension: Month { label: "Month" type: number hidden: yes sql: ${TABLE}.STATEMENT_MONTH ;; } dimension_group: accounting_date { label: "Accounting Period" view_label: "Accounting Period" type: time timeframes: [ date, week, month, day_of_month, day_of_week, day_of_week_index, week_of_year, year, month_name, month_num, quarter, quarter_of_year ] convert_tz: no sql: DATE(CONCAT(${TABLE}.STATEMENT_YEAR, '-', LPAD(${TABLE}.STATEMENT_MONTH, 2, '0'), '-01')) ;; } }