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

How can i group by Variable parms selected.

Status
Not open for further replies.

ronbconfused

Programmer
Sep 26, 2005
25
US
I am on version 10 of crystal. I have a sales report that i have to convert to crystal and i am having trouble. Here's an example of what i need to do:
We will allow variable categories selected from the parms drop down and they will be printed as a Primary, Secondary and Tertiary group with totals. The 3 groups will have the same items to choose from which are Sales Closer, Sales Manager, Price Code and Sale type. As you can see the only 2 that have anything in common is the first 2. If the user selects the first 3 as the primary, secondary and tertiary then the report will show the number of sales by price codes for the sales manager assigned to the closer.

I really have no idea how to do this. i do have a formula set up like this but i'm not sure what to do with it:

Switch (
{?PM-Primary}="Closer",{PersonnelTrans.Title},
{?PM-Primary}="Salesperson",{PersonnelTrans.Title},
{?PM-Primary}="Price Code",ToText ({SalesInventory.Week}),
)

i also have a record select based on each parm but again i am missing something. i have only been working in crystal for less than 2 months. if i had to do this on the as/400 no problem but this has me stumped. i hope i have been at least somewhat clear on this.

thanks for any help you folks can come up with.
 
Please confirm that these tables are all from the same datasource, e.g., Oracle, SQL Server, Access, etc., and that each parameter is set up to take one value, not multiple values.

-LB
 
Already did that. I updated the links also. All files are within the same datasource and the parms are single only. This has got me also. i do not understand why the switch function is not working in the 3 formula fields. i don't want to use a stored proc if i can keep this fairly simple.
 
I tested the switch function in this type of scenario and it worked fine. I can't see anything wrong here. If you think it is the switch function, you can convert the formula to a select case type of formula or a regular if then. For select case, you would use:

Select {?PM-Primary}
case "broker" : {roles.role}
case "lease" : {roles.role}
case "TGEN" : {roles.role}
case "Closer" : {personneltrans.title} //etc.
default : "";

Have you verified the database? I'm out of ideas here.

-LB
 
i did verify the db. there's nothing wrong there. I know this is frustrating. I do appreciate your time. you did way more than you should have. i'll try to attack this tomorrow. i'm fried right now. i don't see why the switch function won't work either.
 
you're not going to believe this! the select statement returned something. that makes no sense at all but this isn't the first time i've seen this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top