Carrot reference
Methods
.sumPercent()
sums each grouped item in a sequence docid\ jg4itlqwafzlparttfo67 or list docid\ xwh cukhj9waqaefb7h71 , and returns each group's sum, as as a percentage of the overall total sum of all items typically this is only used together with a groupby() docid ljo ina1ggcdfqjrwvaf expression, and returns an aggregatedresult that contains each group and its percentage of the total (if used without a groupby, it will always return 100%) syntax sumpercent{expression} evalutes expression on each item in the sequence or list, then returns its percentage of the overall total examples \[1, 2, 3, 4, 5] groupby{it % 2 ? "odd numbers" "even numbers"} sumpercent{it} will return an aggregatedresult of "odd numbers" = 60%, "even numbers" = 40% (because (1 + 3 + 5) / 15 = 60%, and (2 + 4) / 15 = 40%) db job find() groupby{department} sumpercent{basecomp annualized} returns all departments in the organization, grouped by by what percentage of total annualized base comp base is paid to that department