view: dt_playlist_stream_threshold_v2 {
  derived_table: {
    sql:
    SELECT isrcid, playlistid
    FROM facts.prod.fact_analytics
    WHERE playlistid IS NOT NULL
    GROUP BY 1,2
    HAVING {% condition stream_threshold %}SUM(units){% endcondition %} ;;
  }

  filter: stream_threshold {
    view_label: "Playlist"
    description: "Enter a minimum number of Overall Streams that a track must have on a playlist to be included in the query output."
    type: number
  }

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

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