view: int_prod_vw_restrictions_release_supply_chain {
  derived_table:{ sql:

    SELECT * FROM INTELLIGENCE.PROD.RESTRICTIONS_RELEASE_SUPPLY_CHAINS
    WHERE {% condition distribution_type %} distribution_type {% endcondition %}

    ;;}

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


      dimension: list_aggregate_restrictions {
        label: "Restrictions by Supply Chain (List)"
        group_label: "Restrictions"
        type: string
        sql: ${TABLE}.list_aggregate_restrictions ;;
        html:
            {% assign countries = value | split: ";" %}
            {% unless countries.size == 0 %}

              <details>
              <summary>Detail (countries.size)</summary>

              <ul>
              {% for country in countries %}
              <li>{country}</li>
              {% endfor %}
              </ul>
              </details>

            {% endunless %}
            ;;
      }

      filter: distribution_type {
        label: "Distribution Type"
        group_label: "Restrictions"
        description: "Use this to filter store restrictions based on a distribution type (full track, ringtone, etc)"
        type: string
      }
    }
