File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
services/libs/tinybird/pipes Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -114,13 +114,19 @@ SQL >
114114 SELECT
115115 *,
116116 round(
117- 100.0 * arraySum(contributorBenchmarks) / (5 * length(contributorBenchmarks))
117+ 100.0
118+ * arraySum(contributorBenchmarks)
119+ / if(length(contributorBenchmarks) = 0, 1, 5 * length(contributorBenchmarks))
118120 ) AS contributorPercentage,
119121 round(
120- 100.0 * arraySum(popularityBenchmarks) / (5 * length(popularityBenchmarks))
122+ 100.0
123+ * arraySum(popularityBenchmarks)
124+ / if(length(popularityBenchmarks) = 0, 1, 5 * length(popularityBenchmarks))
121125 ) AS popularityPercentage,
122126 round(
123- 100.0 * arraySum(developmentBenchmarks) / (5 * length(developmentBenchmarks))
127+ 100.0
128+ * arraySum(developmentBenchmarks)
129+ / if(length(developmentBenchmarks) = 0, 1, 5 * length(developmentBenchmarks))
124130 ) AS developmentPercentage,
125131 round(
126132 (contributorPercentage + popularityPercentage + developmentPercentage + securityPercentage)
You can’t perform that action at this time.
0 commit comments