cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering Data

Former Member
0 Kudos

Hello, this is probably easy but i'm newish to Crystal so i need some help. I have an SQL table that has data, lets use cars as an example.. mustang, escape, and corvette. I want to list this data in this report by say brand, which is not included in any table, so i need to have a row called Ford and have a column that summarizes the sales data for the mustang and escape, and the same for chevrolet which includes the corvette and so on. What is the best way to do this? I have tried creating a group, then using the select expert to select the entries for each brand but all it does is create a group with many empty rows below it suppressing the model before the next group. Any suggestions on the best way create this report?

simple sample..

product total sales

ford #######

chevrolet ######

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I've tried both of the suggested posts and the syntax appears to be slightly off but i've modified it for my purposes and it still does not output the results i'm looking for.

Brian mentioned that i may have been on the right path, so as mentioend when i used the record expert it shows many blank rows below the header, how can i remove all of those so that only the header shows?

former_member260594
Active Contributor
0 Kudos

Rod,

As long as the makes and manufacturers stay somewhat consistent then you could group on Car and used specified order to create your own groupings.

To do this;

In the group expert highlight Car and select options

Change it from ascending order to specified order

Name the groups, ie Ford, GM, etc

After creating each named group click new and change from is any value to is one of and select the makes for that manufacturer.

You can summarize the data at the manufacturer level.

Answers (2)

Answers (2)

former_member292966
Active Contributor
0 Kudos

Hi Rod,

Following your example, if the manufacturer is no where in the data then you will have to define it yourself. You suggested a good way of doing it and is most likely the best.

Another way to do this would be to create a formula like:

If {table.FIELD1} In ["Mustang", "Escape"] Then

"Ford"

Else If {table.FIELD1} In ["Corvette"] Then

"Chevrolet";

You can take this formula and add it to your selection formula. The only problem with this is it will slow down the report because the filtering will be done on your workstation and not the server.

Good luck,

Brian

Former Member
0 Kudos

you need to create a formula by brand

if car= mustang the 'FORD'

else if car= corvette then 'CHEVY'

etc.

use that for the group

then create a parameter by what you want to filter the car type or the car name add an ALL in the parameter to retrieve all records(make it the first one)

in the record selection

if paramter ="ALL' then true else = parameter

you can replace the field with your formula

hope this helps