7.14 Calculate proportion using aggregation information of data of the same group

 

Here below is an annual and quarterly sales data table:

imagepng

The following code is to calculate the proportion of each quarterly sales to the total sales of the year (calculate in cell D1):

=spl("=E(?1).group(Year).((a=~.sum(Sales),~.(Sales/a))).conj().new(~:Proportion)",A1:C21)

imagepng


esProc Desktop and Excel Processing
7.13 String concatenation and aggregation
7.15 Generate number in each group