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

Need to group by groupcode then, within each group, sort by descending YTD fld for each custid

Status
Not open for further replies.

rmg1

Technical User
Sep 2, 2012
13
0
0
US
I need to do the following:
CustID / YTD Total / Jan Price / Feb Price / Mar Price / Apr Price / May Price
CustGroup A
10 / 141,646 / 12,964 / 32,150 / 47,951 / 25,457 / 23,123
1 / 67,542 / 10,333 / 13,151 / 26,326 / 7,826 / 9,906
4 / 3,070 / 1,320 / 1,386 / 0 / 181 / 181

CustGroup B
6 / 629,385 / 1,449 / 482,889 / 128,341 / 12,225 / 4,461
3 / 560,162 / 311,142 / 76,233 / 4,904 / 71,664 / 96,219
2 / 247,743 / 0 / 1,200- / 54,426 / 24,182 / 170,335

A detail field, ExtPrice, is used to calculate all column and row totals (using running totals). One row is for totals by CustID, which is the total I need to have for YTD Price for sorting in descending sequence (as shown above).

How do I keep my running totals and still be able to sort by YTD Price (descending) for a CustID within the CustGroup?
 
Maybe this will help clarify the outcome wanted:

[pre]
IT Cust No Customer Name 2013 Sales % of 2013 YTD 2014 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
CAT

5 Feline Equity 141,646 12,964 32,150 47,951 25,457 23,123
2 Mew-Mew 67,542 10,333 13,151 26,326 7,826 9,906
10 Purr-fect Challenge 3,070 1,320 1,386 181 181
Total: 212,258 24,617 46,688 74,278 33,465 33,211

DOG

* 2279 Canine Advantage 629,365 1,449 482,889 128,341 12,225 4,461
2156 Surely Ralph's 560,162 311,142 76,233 4,904 71,664 96,219
1195 Wag Away 247,743 1,200- 54,426 24,182 170,335
1881 Doggy Games 155,308 39,819 98,510 5,939 11,041
2612 Whistlin' Dpggy 140,275 42,649 950 96,676
Total: 1,732,853 395,058 557,922 287,131 210,686 282,056


THE FOLLOWING IS THE TOTALS PAGE - SORT ON YTD TOTALS IS NOT TO BE APPLIED (it is also a subreport)


Total: CAT 0.00% 212,258 24,617 46,688 74,278 33,465 33,211
Total: DOG 0.00% 1,732,853 395,058 557,922 287,131 210,686 282,056

Grand Total: 0 0.00% 1,945,111 419,675 604,610 361,408 244,151 315,267

[/pre]
 
Which version of Crystal are you using? In the newer versions (I think starting with Crystal 2008) there is a "Group Sort Expert" available on the Report menu that will help you with this type of sort.

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top