Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to strip out year

Status
Not open for further replies.

nickloe

IS-IT--Management
Feb 9, 2009
6
US
Hello, I am trying to create a formula field using Crystal Syntax that will evaluate three years of sales and just SUM sales from a specific year. I can't get it to work!

I have tried...

Sum ({OPPORTUNITY.ACTUALAMOUNT}, {OPPORTUNITY.DATECLOSED})

Can anyone help?

Thanks!!
 
Create one formula per year, e.g.:

//{@2009amt}:
if year({table.date}) = 2009 then {table.amt}

Then place each one in the detail section and insert a sum on it at any group or report level.

Or, if you are grouping on date on change of year, then again you can just insert a sum on the amount field, or write a formula:

sum({table.amt},{table.date},"annually")

-LB
 
Thank you so much for your help, that worked great!

Not to be a pain, but how would I use this same formula to only pull YeartoDate for each of the years? In other words, Aug 31, 2008 and Aug 31, 2009 and Aug 31, 2010?

Thanks!!
 
//{@ThisYearYTD}:
if {table.date} in YearToDate then {table.amt}

//{@LastYearYTD}:
if {table.date} in LastYearYTD then {table.amt}

///{@TwoYearsAgo}:
if {table.date} in dateserial(year(currentdate)-2,1,1) to
dateserial(year(currentdate)-2,month(currentdate),day(currentdate)) then
{table.amt}

-LB
 
Thank you very much! Worked as needed.

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top