Fussionweb
Fussionweb

Reputation: 280

How to multi group the records of same field in crystal report

Here is the data of field called Stock item
Stock Items
"The Gu" red shirt XML tag t-shirt (Black) 3XL
"The Gu" red shirt XML tag t-shirt (Black) 3XS
"The Gu" red shirt XML tag t-shirt (Black) 4XL
"The Gu" red shirt XML tag t-shirt (Black) 4XS
"The Gu" red shirt XML tag t-shirt (Black) 5XL
"The Gu" red shirt XML tag t-shirt (Black) 5XS
"The Gu" red shirt XML tag t-shirt (White) 3XL
"The Gu" red shirt XML tag t-shirt (White) 3XS
"The Gu" red shirt XML tag t-shirt (White) 4XL
"The Gu" red shirt XML tag t-shirt (White) 4XS
"The Gu" red shirt XML tag t-shirt (White) 5XL
"The Gu" red shirt XML tag t-shirt (White) 5XS

This should group with different name like example

Group Black

    "The Gu" red shirt XML tag t-shirt (Black) 3XL
    "The Gu" red shirt XML tag t-shirt (Black) 3XS
    "The Gu" red shirt XML tag t-shirt (Black) 4XL
    "The Gu" red shirt XML tag t-shirt (Black) 4XS
    "The Gu" red shirt XML tag t-shirt (Black) 5XL
    "The Gu" red shirt XML tag t-shirt (Black) 5XS

Group white

    "The Gu" red shirt XML tag t-shirt (White) 3XL
    "The Gu" red shirt XML tag t-shirt (White) 3XS
    "The Gu" red shirt XML tag t-shirt (White) 4XL
    "The Gu" red shirt XML tag t-shirt (White) 4XS
    "The Gu" red shirt XML tag t-shirt (White) 5XL
    "The Gu" red shirt XML tag t-shirt (White) 5XS

without selection group enter image description here
Like this i kind of report, but this one is edited one

Upvotes: 0

Views: 921

Answers (2)

Clay Coleman
Clay Coleman

Reputation: 71

To expand on CoSpringsGuy's answer, you need to create a formula using what he provided: split(split({stockitem},")")[1],"(")[2].

Formula Workshop You can ignore "Sheet1_" in my screenshot - this is because I used Excel to recreate your data source. If you're using a database this would be the name of the table containing the "stockitem" column. I just named the formula "formula" for this example, but you can name it whatever you want.

Now you need to add a grouping based on the formula you just created.

Group Expert

The group name (i.e. Black, White) will be added by default. You'll also want to add the StockItem column to the Detail section.

The design will look like this:

design

The result will look like this:

result

Upvotes: 1

CoSpringsGuy
CoSpringsGuy

Reputation: 1645

I suspect you will have a lot of other samples that will need a better solution but for this specific sample of records you can create formula

split(split({stockitem},")")[1],"(")[2]

and group on that formula.

Upvotes: 1

Related Questions