view: orch_app_ar_project {
  sql_table_name: orchard_app_reporting_v2.art_relations_prod_art_relations.project ;;

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

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

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

  dimension: project_name {
    type: string
    sql: ${TABLE}.project_name ;;
    primary_key: no
  }

  dimension: description {
    type: string
    sql: ${TABLE}.description ;;
    html:
    {% assign description = value %}

          <details>
          <summary> Detail </summary>
           {{description}}
          </details>;;
  }

  dimension: project_description_check {
    label: "Project Description Check"
    type: string
    sql: iff(length(${TABLE}.description) = 0, 'Needed', 'Have') ;;

  }

  dimension_group: created_date  {
    type: time
    label: "Created Date"
    sql: ${TABLE}.created_date_utc ;;
    timeframes: [
      date,
      month,
      month_num,
      month_name,
      quarter,
      quarter_of_year,
      year,
      fiscal_month_num,
      fiscal_quarter,
      fiscal_quarter_of_year,
      fiscal_year
    ]
  }

}
