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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to write formula for display Actual year & Last Year Data 1

Status
Not open for further replies.

soushi01

Technical User
Dec 27, 2010
31
0
0
MY
hi, Im a newbie of crystal report user

i hv a data like this, need to display Actual year (base on revenue 2010), then Last year (base on revenue 2009)
Year Month Product Revenue
2010 Jan_____ A_____ 2230
2010 Feb_____ A_____ 2000
2010 Mar_____ A_____ 4100
2010 Apr_____ A_____ 3000
2010 Jan_____ B_____ 1230
2010 Feb_____ B_____ 2000
2010 Mar_____ B_____ 4100
2010 Apr_____ B_____ 3000
2009 Jan_____ A_____ 4300
2009 Feb_____ A_____ 7700
2009 Mar_____ A_____ 4300
2009 Apr_____ A_____ 2500
2009 Jan_____ B_____ 5300
2009 Feb_____ B_____ 7700
2009 Mar_____ B_____ 4300
2009 Apr_____ B_____ 8500


Then how to write a formula that display like this :(
Month Product Actual Revenue(2010) Target Revenue(2009)
Jan______ A______ 2230 4300
Feb______ A______ 2000 7700
Mar______ A______ 4100 4300
Apr______ A______ 3000 2500
Jan______ B______ 1230 5300
Feb______ B______ 2000 7700
Mar______ B______ 7100 4300
Apr______ B______ 3000 8500


thans

regards
s1


 
First you need to clarify whether year and month are derived from a date type field, or whether these are a number field (year) and string field (monthname).

-LB

 
Hi, LB

Year & month just a String value.

thanks
regards
s1
 
Hi,LB

As i know can use Cross-Tab to display compare the year,
other than that, can write some formula , then display like a cross-tab format.

i try this formula before but i don't think is best way
create formula @Year2010 -> if {Year}="2010" then {Revenue}
create formula @Year2009 -> if {Year}="2009" then {Revenue}

any solution ?

thanks
regards
s1
 
You should be able to insert a crosstab and year as the column and Product as your Row #1 and Month as your Row#2. This however will change the order of the row columns. If you really want the column order above, add the Product as the first and third rows and suppress the first column.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top