Reputation:
I have a stored procedure in Oracle which will return following 5 columns given below Ordered by (ORDER BY) Date, Account,Asset, Amount and Type.
In Crystal Reports I have grouped the output returned by procedure based on the columns Date, Account and Asset.
The ouput from crystal report is given below.
Date Account Asset Amount Type
Date1 Account1 Asset1 Amount1 Buy
Date1 Account1 Asset1 Amount1 Sell
Date1 Account1 Asset1 Amount2 Buy
Date1 Account1 Asset1 Amount2 Sell
Date2 Account2 Asset2 Amount3 Buy
Date2 Account2 Asset2 Amount4 Sell
Date2 Account2 Asset2 Amount5 Sell
Date3 Account3 Asset3 Amount6 Buy
Date3 Account3 Asset3 Amount6 Sell
Date4 Account4 Asset4 Amount7 Buy
Date4 Account4 Asset4 Amount7 Buy
Date4 Account4 Asset4 Amount8 Sell
Question : Is there any possible way in crystal to seperate the first group of result as below based on the column Amount by only grouping Date, Account and Asset so that it will not affect the other group of outputs. (or)
Date Account Asset Amount Type
Date1 Account1 Asset1 Amount1 Buy
Date1 Account1 Asset1 Amount1 Sell
Date1 Account1 Asset1 Amount2 Buy
Date1 Account1 Asset1 Amount2 Sell
Date2 Account2 Asset2 Amount3 Buy
Date2 Account2 Asset2 Amount4 Sell
Date2 Account2 Asset2 Amount5 Sell
Date3 Account3 Asset3 Amount6 Buy
Date3 Account3 Asset3 Amount6 Sell
Date4 Account4 Asset4 Amount7 Buy
Date4 Account4 Asset4 Amount7 Buy
Date4 Account4 Asset4 Amount8 Sell
Upvotes: 0
Views: 321
Reputation: 4697
Unless I am missing something it looks like you simply need to change your grouping order from:
Date, Account, Asset, Amount, Type
to:
Date, Account, Asset, Type, Amount
So the answer would be to add a group by Amount and Type since you said that it is already grouped by Date, Account, and Asset.
Hope this helps.
Upvotes: 2
Reputation: 81
Using sub-groups might be what you are looking for. Our application uses Crystal to generate statements, and we have several groupings so we can separate and total at different levels:
We use the grouping summaries to list sub-totals under each sale and total balance for each customer.
If you are using one group for Date, Account, and Asset, try adding a new group (menu Insert --> Group) and pick Amount as the grouped by. Crystal keeps the details section intact. You can then add extra space at the end of each Amount group, or insert group-sub-totals (right-click a field and from the pop-up pick Insert --> Summary ) as you need. Crystal allows at least five grouping levels.
Upvotes: 0
Reputation: 8381
If I were you I would make the grouping condition a formula that has your normal logic and an OR to check for your special logic
Upvotes: 0