Link to home
Start Free TrialLog in
Avatar of cgettel
cgettel

asked on

Crystal Reports: Cross-Tab Group Options > Use a Formula as Group Sort Order

I have a cross-tab report where each row is for one customer type.  However, I only want to look at two customer types.  Either dealer or not dealer.

I wrote to formulas:
Dealer
{CUST.CTYPE} = "D"

Direct
{CUST.CTYPE} <> "D"

I right click on Row #1 Name and choose Row Options > Group Options...
In Cross-Tab Group Options I check Use a Formula as Group Sort Order and click x+2.
In the Formula Workshop - Group Sort Order Formula box, I cannot figure out what to do with my formulas.

If I put them both in the edit box,
   {CUST.CTYPE} = "D"
   {CUST.CTYPE} <> "D"
I get this error:
   A constant expression is required here.

How do I actually place my formulas in the edit box.  I tried using the formula names as well.
   @Dealer
   @Direct
And got this error:
   The remaining text does not appear to be part of the formula.
 
Avatar of Mike McCracken
Mike McCracken

The formula for Sort Order is looking to get crAscending, crDescending, crOriginalOrder to tell which sort order to use.

You could try using SPECIFIED ORDER but that would require you to specify the correct order.

You could add a formula like
If {CUST.CTYPE} = "D" then
    "Dealer - " & {CustomerNameField}
Else
    "Direct - " & {CustomerNameField}

You can then use the 2nd tab and use the CustomerNameField as what is displayed.

mlmcc

Avatar of cgettel

ASKER

Ah, so I uncommented the crAscendingOrder that was already in the edit box when I pulled it up.

Then I added
If {CUST.CTYPE} = "D" then
   "Dealer - " & {Dealer Sales}
Else
   "Direct - " & {Direct Sales}

x+2 give this error:
   The remaining text does not appear to be part of the formula.

I'm going to lunch.  I'll check back in an hour.

thanks mlmcc.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cgettel

ASKER

Thank you!