Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Adding Quantity Post Reply Post New Topic
Author Message
khyulitz10
Newbie
Newbie


Joined: 11 Aug 2011
Location: United Kingdom
Online Status: Offline
Posts: 24
Quote khyulitz10 Replybullet Topic: Adding Quantity
    Posted: 08 Nov 2011 at 5:17am
Hi,
 
Hope someone can help me out for this.
 
 
This sounds so simple but yet I can't figure out how to add this.
 
Basically, I have two ITEM NOs and each one of it has LOT NUMBER.
 
ITEM                         LOT NUMBER             QUANTITY
0001                         101                           600
                                102                           400
1002                         103                           900
 
I want to sum up  the quantity of each ITEM and put the result in the quantity field. So in this case, the resul would be something like this.
 
ITEM                         LOT NUMBER              QUANTITY
0001                         101                             1000
                                 102                            
1002                         103                              900
 
 
I made a group for ITEM.. (ItemNum)    
 
I counted the LOT NUMBER using Running Field.. (TotalLotNum)
Field to summarize: Item.LotNum
Type of Summary: Distinct Count
Evaluate: Group 2 ItemNum
On each Field: Item.ItemNum
 
And then made a FORMULA FIELD and typed this formula in..
 
if (#TotalLotNum) > 1 then Quantity * 2
 
But this is giving me 0.00 result..
 
Can someone please help me out on this one. I spent too much time to solve this but still no luck.
 
Thanks so much...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Nov 2011 at 5:24am
runing totals (and variable formulas) cannot be placed in headers and show totals. They must be placed in a location that allowed all of the row values that make up the total to have been displayed in the report already (e.g. detail or footer sections).
If you do not have duplicate rows you can use an insert summary function.
SUM(quantity,item)
that can be placed in the group header


Edited by DBlank - 08 Nov 2011 at 5:32am
IP IP Logged
khyulitz10
Newbie
Newbie


Joined: 11 Aug 2011
Location: United Kingdom
Online Status: Offline
Posts: 24
Quote khyulitz10 Replybullet Posted: 08 Nov 2011 at 5:55am
Thanks DBlank for your quick reply. Aprreciate it a lot Smile
 
The quantity belongs to the ITEM group so I have to place it in there. Is there any other way I could do it please?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Nov 2011 at 6:43am

if i understand your data correctly...

group on item
create a formual field as
SUM({table.quantity},{table.item})
Place this on the detail section
you should get the correct value ,just duplicated for each row (lot number)
right click on the formula field
select Common tab
mark 'Suppres if duplicated' as true (checked)
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.018 seconds.