view: awal_facts_prod_dim_label {
  sql_table_name: facts.prod.dim_label ;;

  dimension: label_id {
    type: number
    sql: ${TABLE}.labelid ;;
    primary_key: yes
  }


  dimension: label_name {
    type: string
    sql: ${TABLE}.labelname ;;
    link: {
      label: "Spotify Fraud Detection Deep Dive - Label Lavel"
      url:"

      {% if _explore._name == 'int_dbt_prod_weekly_fraudulent_streams_flags_spotify' %}

      https://theorchard.looker.com/dashboards/2025?Label+ID={{int_dbt_prod_weekly_fraudulent_streams_flags_spotify.label_id._value }}

      {% elsif _explore._name == 'int_dbt_prod_stg_sos_fraud_spike_over_500_pct' %}

      https://theorchard.looker.com/dashboards/2025?Label+ID={{int_dbt_prod_stg_sos_fraud_spike_over_500_pct.labelid._value }}


      {% endif %}

      "

    }
  }

  dimension: country_id {
    type: number
    sql: ${TABLE}.countryid ;;
    hidden: yes
  }

  dimension: owner_id {
    type: number
    sql: ${TABLE}.ownerid ;;
    hidden: yes
  }

  dimension: column {
    type: string
    label: "URL To Label Review Dashboard USD"
    view_label: "Label"
    hidden: no
    sql: 'Click Here for the Label Review Dashboard USD';;
    link: {
      label: "Label summary sheet"
      url:"https://theorchard.looker.com/dashboards/2038?Label+ID={{facts_prod_dim_label.label_id._value }}&%0A+++++Country+Name+=&Store+Name="
    }
  }

  measure: number_of_labels{
    type: count_distinct
    sql: ${TABLE}.labelid;;
  }

  dimension: brandid {
    type: string
    sql: ${TABLE}.brandid ;;
  }


}

# Missing Fields: is_distributor, owner_id, owner(_name?), priority, date_created, last_udpated
