Query editor
WITH cumulative_share AS (SELECTCOALESCE(program_name, program_id) as program,program_cu_share,SUM(program_cu_share) OVER (ORDER BY program_cu_share DESC) as cumulative_share,ROW_NUMBER() OVER (ORDER BY program_cu_share DESC) as program_rankFROM query_4411608)SELECTthreshold,COUNT(*) as programs_needed,MAX(cumulative_share) as actual_shareFROM cumulative_shareCROSS JOIN (VALUES (0.50), (0.75), (0.90), (0.95), (0.99)) AS t(threshold)WHERE cumulative_share <= thresholdGROUP BY thresholdORDER BY threshold;