Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Data for most recent complete month Post Reply Post New Topic
Author Message
walkitinkid
Newbie
Newbie


Joined: 16 Jun 2011
Online Status: Offline
Posts: 16
Quote walkitinkid Replybullet Topic: Data for most recent complete month
     Posted: 16 Jun 2011 at 2:01pm
Hi, me again
 
let's use this formula because it's simple
 
numberVar applcnt := 0;
applcnt := if {ado.EventType} = "Submit Application" then applcnt+1 else applcnt;
 
how do I get the count for the most recent complete month?
IP IP Logged
walkitinkid
Newbie
Newbie


Joined: 16 Jun 2011
Online Status: Offline
Posts: 16
Quote walkitinkid Replybullet Posted: 17 Jun 2011 at 2:56am

In addition to the most recent complete month, how do I get the month prior?

thanks
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 17 Jun 2011 at 3:03am
How do you determine whether a month is "complete"?
IP IP Logged
walkitinkid
Newbie
Newbie


Joined: 16 Jun 2011
Online Status: Offline
Posts: 16
Quote walkitinkid Replybullet Posted: 17 Jun 2011 at 3:12am
I hope I understand what your asking, I'm very new to this.

The first day of last month thru the last day of last month.

Also the same for the month prior, but I don't want to have to code a new report every month.
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 17 Jun 2011 at 3:58am
So for example if you ran a the report today, you would get the results for may, and if you ran it on july 1, you would get the results for june.

So no matter when you run the report, you want to get the results for the previous month.

One way to do it would be to filter your results to only show those from the previous month. This can be done with a selection formula or somehow querying only the specific set of records.

I'm not sure about the details.

Once you get that, you know that your count is everything for the previous month.
IP IP Logged
walkitinkid
Newbie
Newbie


Joined: 16 Jun 2011
Online Status: Offline
Posts: 16
Quote walkitinkid Replybullet Posted: 17 Jun 2011 at 4:01am
CORRECT! What I need is help with the formula.
IP IP Logged
walkitinkid
Newbie
Newbie


Joined: 16 Jun 2011
Online Status: Offline
Posts: 16
Quote walkitinkid Replybullet Posted: 17 Jun 2011 at 4:29pm
OK after some research, I got this far
 
i made a formula called @pfday that has one line:

minimum(Lastfullmonth)
 
and a formula called @lfday that has one line:
 
maximum(Lastfullmonth)
 
Now onto the formula:
 
numberVar applcnt := 0;
applcnt := if {ado.EventType} in [{@pfday} to {@plday}] = "Submit Application" then applcnt+1 else applcnt;
 
it gives me a syntax error "the keyword then is missing" and highlights the 2nd = sign(before "Submit")
 
what is the proper syntax?
IP IP Logged
CircleD
Senior Member
Senior Member
Avatar

Joined: 11 Mar 2011
Location: United States
Online Status: Offline
Posts: 251
Quote CircleD Replybullet Posted: 17 Jun 2011 at 6:37pm
Originally posted by walkitinkid

Hi, me again
 
let's use this formula because it's simple
 
numberVar applcnt := 0;
applcnt := if {ado.EventType} = "Submit Application" then applcnt+1 else applcnt;
 
how do I get the count for the most recent complete month?


Originally posted by walkitinkid

In addition to the most recent complete month, how do I get the month prior?

thanks


Have you tried just setting up a parameter to input a date range.You should be able to pull up any month you want then.If you just wanted the last full month you could have used the LastFullMonth function but you added the previous month too so you have to go another route.
IP IP Logged
walkitinkid
Newbie
Newbie


Joined: 16 Jun 2011
Online Status: Offline
Posts: 16
Quote walkitinkid Replybullet Posted: 18 Jun 2011 at 1:50am
Circle,

The client has asked for columns of each month over the last 3 months so that she can compare month to month on one sheet.
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 20 Jun 2011 at 6:55am
not sure what data source you are using
if {ado.EventType} in [{@pfday} to
{@plday}] = "Submit Application" then applcnt+1 else applcnt;

if {Date(field)} in
{@pfday} to {@plday} and {ado.EventType}= "Submit Application" then applcnt+1 else
if
if {Date(field)} in {@pfday} to {@plday} and {ado.EventType}<> "Submit Application"then applcnt
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