Hi,
I'm having a problem with correct transaction amounts appearing on my reports. I'm not sure whether it's due to the database design or if I'm not creating the report correctly with Crystal.
I have 3 tables:
1. Deal
Deal_ID (primary key)
Deal_Date
Deal_Amount
2. Attribute_List
Attribute_ID (primary key)
Attribute_Description
3. Deal_Attributes (junction table linking Deals with their Attributes)
Deal_ID (primary key)
Attribute_ID (primary key)
Here's some data.
Deal table
Deal_ID: 1
Deal_Date: 01/01/2001
Deal_Amount: $15 000 000.00
Attribute_List table
Attribute_ID: 1
Attribute_Description: Cross Border
Attribute_ID: 2
Attribute_Description: IPO
Deal_Attribute table
Deal_ID: 1
Attribute_ID:1
Deal_ID: 1
Attribute_ID: 2
(i.e. as you can see in the last table Deal 1 has both attributes: Cross Border and IPO).
The report is grouped by date and the detail section only shows Deal_ID and Deal_Amount. The report has a parameter field on the Attribute_Description field so that the user can choose to see deals with certain attributes. I've placed this in the header section along with a formula field that displays the attribute(s) chosen for the report.
There's no problem if the user chooses "Cross Border" in the parameter field, the correct amount will appear on the report. But, if they choose both "Cross Border" and "IPO" the report doubles the Deal_Amount field and the report displays $30 000 000.00, instead of the deals correct $15 000 000.00 amount. Additionally, the user can choose "All Attributes" if they want to see all the deals. This causes a problem, too, because instead of showing the deal's correct amount, the report doubles up each deal's transaction if it's associated with more than one attribute.
Here's the SQL statement.
SELECT
Attribute_List.Attribute_Description,
Deal.Deal_ID, Deal.Deal_Date, Deal.Deal_Amount
FROM
Deal_Attribute,
Attribute_List,
Deal
WHERE
Deal_Attribute.Attribute_ID = Attribute_List.Attribute_ID AND
Deal_Attribute.Deal_ID = Deal.Deal_ID AND
(Attribute_List.Attribute_Desciption = 'IPO' OR
Attribute_List.Attribute_Description = 'Cross Border')
How can I get the correct transaction amount to show up on the report?
Thanks very much,
Karen
I'm having a problem with correct transaction amounts appearing on my reports. I'm not sure whether it's due to the database design or if I'm not creating the report correctly with Crystal.
I have 3 tables:
1. Deal
Deal_ID (primary key)
Deal_Date
Deal_Amount
2. Attribute_List
Attribute_ID (primary key)
Attribute_Description
3. Deal_Attributes (junction table linking Deals with their Attributes)
Deal_ID (primary key)
Attribute_ID (primary key)
Here's some data.
Deal table
Deal_ID: 1
Deal_Date: 01/01/2001
Deal_Amount: $15 000 000.00
Attribute_List table
Attribute_ID: 1
Attribute_Description: Cross Border
Attribute_ID: 2
Attribute_Description: IPO
Deal_Attribute table
Deal_ID: 1
Attribute_ID:1
Deal_ID: 1
Attribute_ID: 2
(i.e. as you can see in the last table Deal 1 has both attributes: Cross Border and IPO).
The report is grouped by date and the detail section only shows Deal_ID and Deal_Amount. The report has a parameter field on the Attribute_Description field so that the user can choose to see deals with certain attributes. I've placed this in the header section along with a formula field that displays the attribute(s) chosen for the report.
There's no problem if the user chooses "Cross Border" in the parameter field, the correct amount will appear on the report. But, if they choose both "Cross Border" and "IPO" the report doubles the Deal_Amount field and the report displays $30 000 000.00, instead of the deals correct $15 000 000.00 amount. Additionally, the user can choose "All Attributes" if they want to see all the deals. This causes a problem, too, because instead of showing the deal's correct amount, the report doubles up each deal's transaction if it's associated with more than one attribute.
Here's the SQL statement.
SELECT
Attribute_List.Attribute_Description,
Deal.Deal_ID, Deal.Deal_Date, Deal.Deal_Amount
FROM
Deal_Attribute,
Attribute_List,
Deal
WHERE
Deal_Attribute.Attribute_ID = Attribute_List.Attribute_ID AND
Deal_Attribute.Deal_ID = Deal.Deal_ID AND
(Attribute_List.Attribute_Desciption = 'IPO' OR
Attribute_List.Attribute_Description = 'Cross Border')
How can I get the correct transaction amount to show up on the report?
Thanks very much,
Karen