1

I need to compare YTD sales of this and last year sales.

How can I achieve that with a simple formula field on the opportunity object?

YTD = Year - To - Date - e.g.: all sales until this date. (and in last year: same date in last year)

  • I don't mind the "Transactional" feature of SF. A real time values/data is fine.
  • I don't think you can achieve this with formula field. The reason i say this because in formula you can not refer other records of same object. Due to this you will not know YTD sale. – AtulRajguru9 Aug 27 '14 at 9:36
2

Salesforce is a transactional database, using real-time values. To report on historical data, you would need analytic snapshots. More info can be found here:

https://help.salesforce.com/apex/HTViewHelpDoc?id=data_about_analytic_snap.htm

  • I need this in real time data. Not only on the snapshots. – Saariko Aug 27 '14 at 10:43
2

What I have done is:

create a formula number field

Name: YTD index

Value:

case(YEAR(CloseDate), 
YEAR(Today()),1, 
YEAR(Today())-1,IF(CloseDate <= date(year(Today())-1,month(Today()),day(Today())),1 , null), 
Null 
)

What it does : for current year sales: set YTD index = 1. For last year, if the close date is less than : today in last year: set YTD = 1.

This gives me an immediate, real time, YTD comparison of sales for both years.

On the requested reports, I add the filter of: YTDindex = 1. Won = true. and this and last year. Merge dates by year/month as you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.