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

How do I use a parameter to select or establish a Group Sort?

Status
Not open for further replies.

jpittawa

Programmer
Oct 2, 2002
51
0
0
US
My reports are deployed using Crystal Enterprise 9.0 on an intranet server. The user's access the reports using ePortfolio.

I have a report that groups on Vendors, Sales Reps, and Customers in that order. The detail level is individual contracts.

Groups:
G1: Vendors
G2: Sales Reps
G3: Customers

Metric Summaries:
Equipment Cost, Gross Margin, Deal Count

Groups are sorted in descending order.

The user needs to be able to view the same report in all three orders. For example, he will need to see the Gross Margin view and then the Deal Count. At present, I have three versions of the report deployed. Clearly, it would be better to pass the report a parameter that specifies which Group Sort to use.
 
Create a formula that returns, based on a parameter, the Cost, the Margin, or 1 (assuming each record counts for 1 deal).

Create a total at all group levels of that formula and use the TopN/Sort Group Expert to sort the groups based on that total.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
IdoMillet (Instructor)

I must be missing something. In regardless of the sort selection, all three metrics are summarized. I can only envision this working if I could ignore two of the metrics.

What am I missing? Could you show some code?

(Sorry, I'm not usually this dense.)

JP
 
If you just need to show one metric, show the totals of the formula as described above.

It wasn't clear you need to show only one type of summary because it seemed like you were asking about how to control the group sort.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Try a formula like {@sort}:

if {?topN sort} = "Equipment Cost" then
{table.equipmentcost} else
if {?topN sort} = "Gross Margin" then
{table.grossmargin} else
if {?topN sort} = "Deal Count" then
{table.dealcount}

Then insert a summary on this formula and go to report->topN/group sort and choose the summary of this formula as the topN sort field.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top