R – Crystal Reports – Grouping of output records

crystal-reports

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

Best Answer

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.

Related Topic