Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Problem with 2 child tables Post Reply Post New Topic
Author Message
mzda
Newbie
Newbie


Joined: 09 Oct 2009
Online Status: Offline
Posts: 5
Quote mzda Replybullet Topic: Problem with 2 child tables
     Posted: 09 Oct 2009 at 4:55am
Hi,
I have this following table construct:
Product:
- Sales statistic (monthly data)
- Sales plan (yearly data)

Sales statistic and sales plan doesn't have link with each other.
Both of the tables are linked to the table product.

I want to sum up the plan values from the table Sales plan. But crystal report make the cartesian product of sales statistic and sales plan, so that the plan value is not calculated correctly.
For example:

Product:
- Laptop X
SAles statistic:
- February 2009 - 1000€
- March 2009 - 500€
- April 2009 - 600€
Sales plan:
- 2009 - 3000€

Product:
- Laptop Y
SAles statistic:
- February 2009 - 1200€
- March 2009 - 300€
- April 2009 - 300€
Sales plan:
- 2009 - 2500€

If I sum up the sales plan, I would get 3000€ x 3(For each month of the sales statistic) + 2500€ x 3
The result should actually 5500€ but I get 16500€.

How to solve this?
BTW, I use XML file as data source.
Thanks.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 12 Oct 2009 at 6:24am
use a formula, and only increment it in the group header, then it doesn't matter how many rows of detail you have.
remember to reset the formula when your grouping changes and to display it where you want it.
 
HTH
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum