June 9, 2015

PREVGROUPVAL in Salesforce Reports

PREVGROUPVAL is a funtion used in custom summary formulas to return the value of a summary field from a previous grouping.

Example:


(AMOUNT:SUM +
PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE) +
PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE, 2) ) / 3 gives average closed Opportunities amount for 3 weeks.

AMOUNT:SUM - Gives current week sum.

PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE)  - Gives previous week sum.

PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE, 2)  - Gives 2 weeks before sum.

Cheers!!!

1 comment:

  1. This is brilliant....the salesforce help was OK but less clear.

    Broken down in this post perfectly.

    Great Help

    ReplyDelete