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

Only displaying last number in running total

Status
Not open for further replies.
Jan 20, 2003
291
US
Crystal 7 (OEM version for Macola)
SQL database

I have built a report that sums the quantity of sales by month for a item. I used running totals based on a monthly grouping. Works correctly.
I only need to display the last total for that month, detail is not important. I see that a function called RTGET may do this but I need to install it first. I am checking on the compatibility since I use a OEM version of Crystal.

The report needs to look like:

Item number jan feb mar .... dec
12345 3 6 12 32

(where months are the sum of the quantity sold.)

Other suggestions welcomed.
 
You haven't explained what the problem is. You should also clarify whether the monthly totals are cumulative or whether they are only for that specific month.

-LB
 
The report actually runs correctly. It's the detailed output that I want to suppress or hide. I only need the last total to display.

The data file I read from is based on all transactions by item number and date. Currently, I filter the data sorted for this year only. I use a formula to extract the 2 digit month.

Grouping is:

Item number & name

Details are comprised of a running total formula for each month in a single row.

Each running total is built on:
1. Summary = summing a qty formula
2. Evaluate = based on the monthly formula set it equal to the month I want i.e. @modate = "01"
3. Reset is set to change on the field @modate

So I want to display:

Item No. Jan Feb ... Dec
12345 12 34 51
 
I think the reset should be set to "on change of group"->your group field (Item #). You are already limiting each running total to a particular month in the evaluation section. Then place the running totals in the group (item) footer and suppress the details section.

-LB
 
I limited the data to this year only (= 2004) so all the months are included in the filtered data.
If I put it in the footer, zero is returned.
 
I understand what you're doing, but if you have a group on item #, the running totals need to be reset at that level. If you change the reset and place the running totals in the group footer, you will have the values for each month displayed horizontally. This assumes you are summing {table.qty}, evaluating based on a formula, something like:

month({table.date}) = 1 //for January. Incremented by 1 for each month

Reset on change of group (item). Because the result is only changed on change of group, the value for each month is carried to the footer. You can see this by placing the running total both in the detail section and the group footer. If you were to use your reset, placing the running total in the footer would get you a zero in all but one case--the one where the date is the last in the group.

Did you try changing the resets on the running totals?

-LB
 
I changed the reset to the group but same result.

But, I did not have the running total in both the detail and in the footer.

Suppress the detail and it worked just fine!

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top