Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula Help Needed Post Reply Post New Topic
Author Message
amcb10
Newbie
Newbie


Joined: 10 Jul 2008
Location: United Kingdom
Online Status: Offline
Posts: 6
Quote amcb10 Replybullet Topic: Formula Help Needed
    Posted: 23 Sep 2008 at 8:51am
Hello All

I currently have a table that requires a formula to group totals but cannot work out how to do it. It is a movement table that lists all stock movements and I would like to summarise these by month.

Here is what I have

ITEM_NUMBER - (200 unique item numbers (Stock Codes)
ITMMOV_MOVEMENT_DATE
ITMMOV_MOVEMENT_CODE (W and S)
ITMMOV_QUANTITY

What I would like to achieve is have a formula called "May" and that will display the sum of all the item number movement quantity for that month.

I have 2 Movement codes that need to be seperated too which are "W" and "S".

Any help would be appreciated

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 23 Sep 2008 at 1:26pm
Do you need to group by month and then by movement code or movement code and then month?  If you can group seperately, this will be easier.
 
For the date field:
Create a group on ITMMOV_MOVEMENT_DATE.  In the Group Expert after you select the field, change the value under "This section will be printed" to "for each month".  You can then format the group name to show the month name for the date field by right-clicking on it and selecting "Format".
 
For the Movement code:
Create a group on ITMMOV_MOVEMENT_CODE.  If you want to display the 'W' first, tell it to sort Descending.  Otherwise leave it at the default of ascending.
 
-Dell
IP IP Logged
amcb10
Newbie
Newbie


Joined: 10 Jul 2008
Location: United Kingdom
Online Status: Offline
Posts: 6
Quote amcb10 Replybullet Posted: 24 Sep 2008 at 4:42am
Many thanks for the reply:

I need to display both the W and S figures side by side so sorting is out of the question.

Say Item "A" has 57 sales in May (40 W and 17S), I need to show on the report Item A - May Works - May Sales.

Hope the above is clearer.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 24 Sep 2008 at 7:29am

I can think of three ways to do this.  Here is the easiest:

Create a formula called {@IsW}:
if {ITMMOV_MOVEMENT_CODE} = 'W' then 1 else 0
Do the same thing for your S values.  You should then be able to add two summaries to your report that will sum these formulas to get the counts of items with W and S.
 
-Dell
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.020 seconds.