view: dt_project_moments_cluster_groups_v2_fuzzy_logic { derived_table: { sql: select *, case when fuzzy_cluster_label = 0 then 'A' when fuzzy_cluster_label = 1 then 'B' when fuzzy_cluster_label = 2 then 'C' when fuzzy_cluster_label = 3 then 'D' when fuzzy_cluster_label = 4 then 'E' when fuzzy_cluster_label = 5 then 'F' else null end as Trending_Group from DEV_ENGINEERING.EIMPARA.MOMENTS_CLUSTERS_TABLE_APR_SEPT_22_POSITIVE_SIGN_V3 union all select *, case when fuzzy_cluster_label = 0 then 'G' when fuzzy_cluster_label = 1 then 'H' when fuzzy_cluster_label = 2 then 'I' when fuzzy_cluster_label = 3 then 'J' when fuzzy_cluster_label = 4 then 'K' when fuzzy_cluster_label = 5 then 'L' else null end as Trending_Group from DEV_ENGINEERING.EIMPARA.MOMENTS_CLUSTERS_TABLE_APR_SEPT_22_NEGATIVE_SIGN_V3 ;; } dimension: isrc { view_label: "Track" label: "ISRC" description: "ISRC" type: string sql: ${TABLE}.isrc ;; } measure: count_isrc { view_label: "Track" label: "Number of Tracks" type: count_distinct sql: ${TABLE}.isrc ;; } dimension: pred_type { view_label: "ML Algorithm Output" label: "Prediction Type" description: "Description on if the actual streams remained above, below, or crossed the predicted stream line" type: string sql: ${TABLE}.pred_type ;; } dimension: nrmse { view_label: "ML Algorithm Output" label: "Normalized Root Mean Squared Error" description: "Normalized Root Mean Squared Error" type: number sql: ${TABLE}.nrmse ;; } dimension: sum_forecast_errors { view_label: "ML Algorithm Output" label: "Predicted vs Actual Stream difference" description: "A sum of the difference between predicted streams vs actual streams - this is used to infer if a tracks streams are operating outside of its typical behaviour; this can indicate the potential of a track" type: number sql: ${TABLE}.sum_forecast_errors ;; value_format: "0" } dimension: sign { view_label: "ML Algorithm Output" label: "Positive or Negative Difference" description: "Positive or Negative - indicates whether the overall actual streams for the track were above (positive) or below (negative) that of the predicted streams" type: string sql: ${TABLE}.sign ;; } dimension: fuzzy_cluster_label{ view_label: "ML Algorithm Output" label: "Fuzzy Cluster Label" description: "Fuzzy Cluster Label for either positive or negative track groupings" type: string sql: ${TABLE}.fuzzy_cluster_label ;; hidden: yes } dimension: trending_group{ view_label: "ML Algorithm Output" label: "Trending Group" description: "Which Trending Group does the track belong to" type: string sql: ${TABLE}.trending_group ;; } }