How to build “Star Rating” report in BigQuery (or sparklines, or color gradients)

后端 未结 5 1154
忘了有多久
忘了有多久 2021-02-03 14:44

Suppose I have the followng sample input:

WITH Ratings AS (
    (SELECT \'A\' name, 2 score) UNION ALL
    (SELECT \'B\' name, 0 score) UNION ALL
    (SELECT \'C         


        
5条回答
  •  别那么骄傲
    2021-02-03 15:30

    My entry does a color gradient, because sparklines only look good with certain fonts - and that's not a font that the BigQuery web UI uses.

    During a day, when is Stack Overflow the most active per tag:

    #standardSQL
    CREATE TEMP FUNCTION barchart(v ARRAY, mm STRUCT) AS ((
        SELECT STRING_AGG(SUBSTR('

提交回复
热议问题