Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Summary error Post Reply Post New Topic
Author Message
hemin
Newbie
Newbie
Avatar

Joined: 15 Aug 2012
Location: Netherlands
Online Status: Offline
Posts: 4
Quote hemin Replybullet Topic: Summary error
     Posted: 15 Aug 2012 at 4:24am

Hello, I'm new to Crystal Reports I try to make a PPM report. I have to tables In table1 I have the rejected parts and in table2 is Sales a link of CSV file uploaded to the server and there we have amount of shipped part per month.

I converted the string field to the right format and linked product in both tables and I group by year month and customer then product. then add the summary of shipped part to group so far everything is OK. but if I add the summary of rejected part from table1 all the summary from table2 are changing. I know is has to do with the link and join type or ME :)

Cay anyone please tell me how to fix this?
Thank you all
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 15 Aug 2012 at 4:27am
You need to try to do a left outer join FROM the sales data TO the rejected data.  This will get you all of the sales data, whether or not there is rejected data.
 
However, I don't know whether Crystal will let you do this type of join between a db table and a csv file.  What type of database are you connecting to?
 
-Dell
IP IP Logged
hemin
Newbie
Newbie
Avatar

Joined: 15 Aug 2012
Location: Netherlands
Online Status: Offline
Posts: 4
Quote hemin Replybullet Posted: 15 Aug 2012 at 8:05pm
Thank you for your reply, I did that as well.
the porblem is like this I shipped in one month item1 qty, 25 this is in sales table.
And in rejected tabel in the same month and the same item i registered 4 times rejected part qty. 1 so the total qty is 4 rejected part.
when I add the summary of rejected parts the qty. of shipped parts will change to 100 this becaus I rejested 4 time rejected part. 25 * 4 =100 this is the problem for each item the shipped qty will be change to times registered  rejected parts.
I grouped by year,month,customer,product from Sales table. 
The CSV file i uploaded to SQL server. I get all the data from the SQL server.
I hope you can help me.
thank you again.
 


Edited by hemin - 16 Aug 2012 at 12:24pm
Thank you.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 16 Aug 2012 at 3:30am
Ok, so what I hear you saying is that you have one record in the sales table and 4 records in the rejected parts table and that is inflating your total quantity.  If this is correct, here's how you get around it:
 
1.  Group by the item field in the sales table.
2.  Create a running total field:
Field to Summarize = your sales qty field
Summary = sum
Evaluate on = Formula - PreviousIsNull({sales.item_field}) or {sales.item_field} <> Previous({sales.item_field})
Reset on = change of group - the group you set up in step 1.
3.  Create another running total field:
Field to Summarize = the rejected qty field
Summary = sum
Evaluate on = Every Record
Reset on = change of group - the group you set up in step 1.
4. Put your data in the footer of the group you set up in step 1.  (Final running total numbers won't be available in the header or details.)
 
-Dell
IP IP Logged
hemin
Newbie
Newbie
Avatar

Joined: 15 Aug 2012
Location: Netherlands
Online Status: Offline
Posts: 4
Quote hemin Replybullet Posted: 18 Aug 2012 at 10:50am
Great, it works.
Thank you,
My next problem is this now I like to show the PPM in chart but the formula fields is not visible to select the vales for the chart.
in the formula fields I have this ( if({#total_rejected_Per_Month}<> 0 )then  ({#total_rejected_Per_Month}/{#Qty_shipped_per_month})*1000000 else 0).
thank you again 
 


Edited by hemin - 18 Aug 2012 at 8:55pm
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 20 Aug 2012 at 3:49am
I haven't done much with charting in Crystal, so I'm afraid I can't help you much there.
 
Sorry!
 
-Dell
IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet Posted: 20 Aug 2012 at 4:02am
Running totals dont work well with charts, and you wont be able to use the previous / PreviousIsNull functions in a chart.
 
If you have all data in SQL then you may have to create a view or storproc to do the above calcs first, then do basic calcs, sums in crystal so you can graph the data.
IP IP Logged
hemin
Newbie
Newbie
Avatar

Joined: 15 Aug 2012
Location: Netherlands
Online Status: Offline
Posts: 4
Quote hemin Replybullet Posted: 29 Aug 2012 at 4:51am
Thank you both.
I don't have access to the SQL server.
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