jrhessey
IS-IT--Management
- Feb 25, 2005
- 37
I have a report built with 2 groups, customer number and sales order number. I am trying to compare items sold and prices ytd, last ytd, and 2 years ago ytd. I created 3 formula fields called cyr, pyr, and 2yr.
cyr is this
if {SO_03SOHistoryHeader.OrderDate} = YearToDate then 1 else 0
pyr is this
if {SO_03SOHistoryHeader.OrderDate} in date(year(currentdate)-1,01, 01) to date(year(currentdate)-1,month(currentdate),day(currentdate)) then 2 else 0
2yr is this
if {SO_03SOHistoryHeader.OrderDate} in date(year(currentdate)-2,01, 01) to date(year(currentdate)-2,month(currentdate),day(currentdate)) then 2 else 0
I then created a field to only show item numbers that occur in each time period.
cyritem# is this
if {@cyr} = 1 then {SO_04SOHistoryDetail.ItemNumber}
That shows the item numbers on sales orders that were purchased ytd.
Now this is my problem, I want to count the total items per customer for cyr only. I used a regular count and it counts all item number for the customer over the 3 years. I tried to create a formula for counting...
cyrcount
if {@cyr}=1 then Count ({@cyritem#})
but that counts for the whole report.
I can't figure out what's going wrong... Any help would be greatly appreciated!
cyr is this
if {SO_03SOHistoryHeader.OrderDate} = YearToDate then 1 else 0
pyr is this
if {SO_03SOHistoryHeader.OrderDate} in date(year(currentdate)-1,01, 01) to date(year(currentdate)-1,month(currentdate),day(currentdate)) then 2 else 0
2yr is this
if {SO_03SOHistoryHeader.OrderDate} in date(year(currentdate)-2,01, 01) to date(year(currentdate)-2,month(currentdate),day(currentdate)) then 2 else 0
I then created a field to only show item numbers that occur in each time period.
cyritem# is this
if {@cyr} = 1 then {SO_04SOHistoryDetail.ItemNumber}
That shows the item numbers on sales orders that were purchased ytd.
Now this is my problem, I want to count the total items per customer for cyr only. I used a regular count and it counts all item number for the customer over the 3 years. I tried to create a formula for counting...
cyrcount
if {@cyr}=1 then Count ({@cyritem#})
but that counts for the whole report.
I can't figure out what's going wrong... Any help would be greatly appreciated!