Hello! I am trying to do:
- Calculate the sum of column 1, 2 and 3
- Take nulls into account
- Calculate column 1 as a % of the sum (step 1)
I have managed steps 1 and 2 but am falling at the divide stage…
Steps one and two:
coalesce(pivot_index(${orders.orders_count},1),0)+ coalesce(pivot_index(${orders.orders_count},2),0)+ coalesce(pivot_index(${orders.orders_count},3
),0)
When I try to add divide on the front it fails...
coalesce(pivot_index(${orders.orders_count},1),0)/
coalesce(pivot_index(${orders.orders_count},1),0)+ coalesce(pivot_index(${orders.orders_count},2),0)+ coalesce(pivot_index(${orders.orders_count},3
),0)
Any ideas would be very much appreciated!
Thank you community!