Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Different Selection Criteria in one report section Post Reply Post New Topic
Author Message
SunnyValentine
Newbie
Newbie


Joined: 28 May 2011
Location: Thailand
Online Status: Offline
Posts: 2
Quote SunnyValentine Replybullet Topic: Different Selection Criteria in one report section
     Posted: 28 May 2011 at 6:15am
Hi!

Pretty new to this all, so please forgive a newbie asking stupid questions!

I need to create a report in CR 2008, where I need to apply different selection criteria .

First I select a date in the report, most data in the report will now be relevant for this date.
But I also need a field that sums up some events from the first of the month selected until the selected date.

So, in the Database I have a table "SalesEvents".
Relevant columns are SalesDate Quantity ProvisionStaffNumber

The whole report centers around the selected date (in a Parameter Field) and a Staff Number.
I need now (amongst other data) to show the number of "Sales Events" where the ProvisionStaffNumber equals the selected staff number. I dont want to show any more details, just the number of these events (multiplied by Quantity).
In the same line in the report I need to show the number of  these events, starting from the first of the selected month, until the chosen date
It should look like this in the report:
Comm Sales Today: 11  Comm sales this month: 61

I cant find out how to put a different selection here?


IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 31 May 2011 at 3:13am
you can use running totals or shared variables.  The shared variables are 'programmed' and basically mimic the logic of running totals.
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 31 May 2011 at 4:55am
First I select a date in the report, most data in the report will now be relevant for this date.
But I also need a field that sums up some events from the first of the month selected until the selected date.

i gather you have date range parameters, do you have 1 or 2?
if i select my date range from 5/15/2011 - 05/31/2011
you need to count the events from the begining of the month to the end date selected?
sharona
IP IP Logged
SunnyValentine
Newbie
Newbie


Joined: 28 May 2011
Location: Thailand
Online Status: Offline
Posts: 2
Quote SunnyValentine Replybullet Posted: 31 May 2011 at 5:46am
Thanks so far.
att lockwelle: where can I find more info on shared parameters?
att sharona:
No range, most data in report is centered around one day.
Just some fields need to be for a set range.
Selected date: YYYYMMDD
Range is then YYYYMM01 - YYMMDD
Guess I could have another parameter here, but as I see it now it would only complicate matters and provoke errors by operators of the report.

The report is going to be used to assess the staff performance on a given day, with an overview of the performance of the current month.
It should serve as a staff overview, and will also include other staff parameters, as salary level, off days consumed, and so on.
I need to show the relevant staff data for the day selected, plus an overview of the current month.

Ok, I have one more problem:
In our Database (Access 2003) the dates are stored as Integers YYYYMMDD.
For a parameter field I now have the operator to enter in this form, or is it possible to use the provided calendar controls even in this case?
I know how to manipulate the Integer into a string to show dates in the report in a YYYY/DD/MM or whatever representation, but would love to use the calendar as well as "Today" features.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 31 May 2011 at 6:28am
shared variables...actually everything I know I learned from CR Help.
 
Basically they are declared/used in formulas and typically come in groups of 3...a reset / initialization formula, an increment formula, and a display formula.
 
Typically reset is in the group header and looks something like:
shared numbervar a := 0;
"" //hides the output
 
The incrementing formula is typically in the detail section:
shared numbervar a;
 
if (table.field} = x then
  a := a + {table.field1};
"" //hides the output
 
the display is typically in the group footer:
shared numbervar a;
a
 
:= is the assignment operator while = is for equality
 
HTH
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 31 May 2011 at 6:35am

it sounds like this is going to be run daily so you really dont need a parameter for date if you only want to go from current date to beginning of that month.

create a current date formula.
if performancedate =currentdate then 1
 
use this in the manual running totals formula given below by lockwelle
 
create a month formula
if performancedate in MonthToDate then 1
 
use this in the manual running totals formula given below by lockwelle
 
this should create a count for the current date and the currentmonth beg date to the currentdate.
 
if you want to run for previous months we can work that out. try this first to see if you get what you want for may
sharona
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