Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Field duplicating Post Reply Post New Topic
Author Message
p0pcan
Newbie
Newbie


Joined: 06 Sep 2011
Online Status: Offline
Posts: 24
Quote p0pcan Replybullet Topic: Field duplicating
     Posted: 12 Jan 2012 at 9:14am
I am trying to run a report that shows a bunch of stats on products in a specified location (we have multiple warehouse so it is based on a single warehouse).  What I am trying to is show a percentage of product available at the specified location (products with at least one piece on hand / products at location).  Now one of the fields in the report is a reservation amount and if a product has more than one reservation on it, the product is duplicating on the report which throws my numbers off.  Even if I group the report by product code so it only shows once, behind the scenes it is still duplicating so my numbers are high. 

How I am getting my numbers is I am doing a count on the number of products that show up in the report (also since some products duplicate I have to use a distinct count) and then if there is one piece available for said product then I have a formula that makes a different field a 1.  If the product has nothing on hand the other field is a 0.  Again, because of the duplication due to the reservations, I am getting multiple 1's for a single product.

Is there a way to do an exists statement of something that say if the product already exists once and there formula field has a 1, make all following records for that product a 0??

Example:
product code         available            on reserve            formula field
product a                  Yes                      3                             1
product a                  Yes                      5                             1

With the above, I do a distinct count on product code (which will only count the above 1 time) but then I need to do a sum on the formula field (as you can see it will double the number here).  What I want to happen is this:

product code         available            on reserve            formula field
product a                  Yes                      3                             1
product a                  Yes                      5                             0

Can this be done??

Thanks
Brandon
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Jan 2012 at 9:24am
this is usually done via shared variables with conditions to include or exclude or Running Totals with evaluation formulas.
IP IP Logged
p0pcan
Newbie
Newbie


Joined: 06 Sep 2011
Online Status: Offline
Posts: 24
Quote p0pcan Replybullet Posted: 12 Jan 2012 at 9:32am
I see I see...could you give me short description on what I should do??  When I do running totals on the field I am getting a way bigger number than I should.
Thanks again
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Jan 2012 at 9:56am
i wold need to see raw level row data (unsppressed) and how you wan that to be counted to really do it
Usually you can do something like
name=whatever
field to summarize=quantity on hand
summary type=sum
evaluate=on change of field (pick the primary key from the on hand table)
reset= never if you want for report or on a group if you want it in a group footer
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