view: awal_facts_prod_dim_artist {
  sql_table_name: facts.prod.dim_artist ;;

  dimension: artist_id {
    type: number
    sql: ${TABLE}.artistid ;;
    primary_key: yes
  }

  dimension: artist_name {
    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 {
    type: number
    sql: ${TABLE}.countryid ;;
    hidden: yes
  }

  measure: count_artists {
    label: "Artists (Count)"
    type: count_distinct
    sql: ${artist_id} ;;
  }

#   dimension: date_created {
#     type: date_time
#     sql: ${TABLE}.date_created ;;
#   }
#
  dimension: labelid {
    type: number
    sql: ${TABLE}.labelid ;;
    hidden: yes
  }
#
#   dimension: last_updated {
#     type: date_time
#     sql: ${TABLE}.last_updated ;;
#   }
}
