We have been very encouraged by Clickhouse. However, as we are trying to port all of our existing scripts to Clickhouse, we are running into few roadblocks. For example: CUMULATIVE SUM or RUNNING TOTAL
. We are trying to find an equivalent of Window Functions e.g. SUM(SALES) OVER (PARTITION BY PRODUCT ORDER BY SALES)
"Percent to total"
.
For e.g
Product | Sales
P1 100
P2 200
P3 150
P4 50
We are looking at writing a script which can populate
Product, Sales, PercenttoTotal
P1, 100, 20%
P2, 200, 40%
P3, 150, 30%
P4, 50, 10%
Is there a quick way via various functions in Clickhouse using which we can accomplish this. Thanks in advance.