view: facts_prod_dim_artist {
  sql_table_name: facts.prod.dim_artist ;;
  suggestions: no

  dimension: artist_id {
    description: "The Orchard assigned unique Artist identifier."
    type: number
    sql: ${TABLE}.artistid ;;
    primary_key: yes
  }

  dimension: artist_name {
    description: "The name of the artist."
    type: string
    sql: ${TABLE}.artistname ;;
    link: {
      label: "Artist View"
      url: "
      {% if _explore._name == 'facts_prod_fact_sales' and facts_prod_dim_artist.artist_name._in_query %}

      https://theorchard.looker.com/dashboards-next/1743?Label+ID={{ facts_prod_dim_label.label_id._value }}&Activity+Date=90+day&Artist+Name={{ facts_prod_dim_artist.artistname._value }}

      {% else %}

      {% endif %}

      "
    }
  }


  dimension: country_id {
    description: "The unique identifier for the country where the artist lives."
    type: number
    sql: ${TABLE}.countryid ;;
    hidden: yes
  }

  measure: count_artists {
    description: "A count of distinct Artist ID's."
    label: "Artists (Count)"
    type: count_distinct
    sql: ${artist_id} ;;
  }


   dimension: labelid {
    description: "The Orchard assigned unique Label identifer."
    type: number
     sql: ${TABLE}.labelid ;;
    hidden: yes
   }

}
