Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Identify customers best month Post Reply Post New Topic
Author Message
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Topic: Identify customers best month
     Posted: 26 Oct 2011 at 3:58am
Good afternoon,
 
I need to build a decline account report.
 
What would be the best way of identifying a customers BEST month based on their quantity purchased? (so simply need to identify which month, in the last 2 years, had the highest quantity of units)
 
I want to go back as far as 2 years.
 
my table contains fields YEAR & PERIOD & QTY
 
the YEAR data is:  31 = 2011,  30 = 2010,  29 = 2009, and so on.
 
the PERIOD data is: 1 = Jan, 2 = Feb, etc...
 
the QTY data is at line level, so I will need to SUM this by customer.
 
 
Any ideas?
 
I currently have the report set up as:
 
Header     CUSTOMER     CURRENT MONTH    LAST MONTH     BEST MONTH
group1     CUSTOMER A          29 units               84 units                ?
                CUSTOMER B         117 units            209 units                ?
                CUSTOMER C     
Etc, etc
 
 
Can anyone advise on a formula for me?
 
 
Thanks in Advance
 
Mike
Regards,

Michael Jones
IP IP Logged
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Posted: 26 Oct 2011 at 4:20am
ok, I found another table I can use that has the total quantitys for the customer. So no need to sum the quantities in the report.
 
this table has fields like:
 
CUSTTURN00   =  Customers current month Turnover
CUSTQTY00   = Customers Current month Quantity
CUSTTURN01  =  Customers Previous month Turnover
CUSTQTY01   = Customers Previous month Quantity
CUSTTURN02  =  Customers Previous month-1 Turnover
CUSTQTY02  =  Customers Previous month-1 Quantity
CUSTTURN03
 
etc..
 
This fields go right up to CUSTTURN60   (5 years of data)
 
 
What is the best way to identify the customers HIGHEST QTY month from all these fields?
 
 
thanks.
 
 
Regards,

Michael Jones
IP IP Logged
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Posted: 26 Oct 2011 at 5:21am
how can I use the MAXIMUM() function?

or how can I create my own array of 30 fields?
 
 
:(
Regards,

Michael Jones
IP IP Logged
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Posted: 26 Oct 2011 at 11:24am
got it to work through reading the help files properly >_<

Dim Bestmonth
Bestmonth = Array({CUSTHIS.SALEQTY00}, {CUSTHIS.SALEQTY01}, {CUSTHIS.SALEQTY02}, {CUSTHIS.SALEQTY03}, {CUSTHIS.SALEQTY04}, {CUSTHIS.SALEQTY05}, _
{CUSTHIS.SALEQTY06}, {CUSTHIS.SALEQTY07}, {CUSTHIS.SALEQTY08}, {CUSTHIS.SALEQTY09}, {CUSTHIS.SALEQTY10}, {CUSTHIS.SALEQTY11}, {CUSTHIS.SALEQTY12})
formula = maximum(Bestmonth)
Regards,

Michael Jones
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