Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: monthly report Post Reply Post New Topic
Author Message
kreusch
Newbie
Newbie


Joined: 04 Nov 2011
Online Status: Offline
Posts: 22
Quote kreusch Replybullet Topic: monthly report
     Posted: 24 Oct 2013 at 1:49am
I need to create a report that gives the user the last 12 months of their sales for each inventory item. so for todays date, oct 24, it would have to show oct 2012 to oct 2013 sales.


           oct'12 nov'12 dec'12 jan'13 feb'13 ...oct'13
part number
part number
part number

How can I get it to create each column based off of the current month? Is this something for crosstabs? I have never used them.

Thanks
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 24 Oct 2013 at 2:07am
Hi
 
Yes, you are right.  You need to use cross tab report to achive this requirement.
 
First you derive start date and end date.
 
In Record Selection use below to filter last one year data :
 
Database.datefield >= date(Year(currentdate)-1,Month(currentdate), 01) and
Database.datefield<= Currentdate
 
Now through Insert menu insert cross tab on report header or footer and in columns place 'Database.datefiled' -- In group options set it for each month
 
In Rows add 'database.inventoryItem
 
In summary field  add Sales value
 
 
Thanks,
Sastry
IP IP Logged
kreusch
Newbie
Newbie


Joined: 04 Nov 2011
Online Status: Offline
Posts: 22
Quote kreusch Replybullet Posted: 25 Oct 2013 at 7:45am
Great!
One question, I am only getting rows for April to Oct...how can I get it give me the last 12 months?
Oct-Oct (for todays date)

Thanks!
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 25 Oct 2013 at 8:20am
the formula provided by Sastry should work,
it could be that you don't have any data for the other months.
IP IP Logged
kreusch
Newbie
Newbie


Joined: 04 Nov 2011
Online Status: Offline
Posts: 22
Quote kreusch Replybullet Posted: 25 Oct 2013 at 8:31am
You are right! Thanks
Now if I want to add part desc next to the part number for each item, can I just put that field in the same column as the part number?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Oct 2013 at 4:47am

i would create a formula field to concantenate the ID number and description then use this formula field in the crosstab row choice (replace the ID numberfield)

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