You can use Running Totals (RT) to do Counts conditionally.
RTs only work in Footers
Group on item desc.
Suppress group header and details
Place the item desc in the group footer
create a RT as "Current period Count"
Field to sumamrize=date field
type=count
evaluate = use a formula
table.datefield in last7days
reset=on group change (group1)
Same thing for current year but change your formula to
table.datefield in YearToDate
LastYearPeriod
table.datefield in dateserial(year(currentdate)-1,month(currentdate),day(currentdate)-7) to dateserial(year(currentdate)-1,month(currentdate),day(currentdate))
Last year ytd as
table.datefield in LastYearYTD
Edited by DBlank - 10 Apr 2010 at 6:11am