Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

comparisons on one report

Status
Not open for further replies.

eekk

Technical User
Jun 25, 2007
8
FR
Hello,

I need to display a comparison on one report between 2 different date ranges.
The report has already a data range formula set which is

{COMPLAINT_ISSUE.COMPLETED_DATE} >= {?Date Range} and {COMPLAINT_ISSUE.COMPLETED_DATE} <= {?Upper Date Range}

how can I modify this to input 2 different ranges to compare?

Thanks in advance for your help!
 
If you have two range parameters the condition should look like
{COMPLAINT_ISSUE.COMPLETED_DATE} in {?Date Range} OR
{COMPLAINT_ISSUE.COMPLETED_DATE} in {?Upper Date Range}

- Ido

view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Maybe I didn't explain well :S

What I need to do is get a comparison between 2 different date ranges like
Complaints from 01/01/06 to 30/04/06
Complaints from 01/01/07 to 30/04/07
the one above is what is already set as date range as parameter when running the report.

Does this make more sense?
 
Hi,
Please explain what you mean by 'compare' -
Compare what to what?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
ok, sorry again :S

I want (in the same report) compare (maybe would be better say display result) complaints/record between
DATERANGE A from 01/01/06 to 30/04/06
and
DATERANGE B from 01/01/07 to 30/04/07

hopefully this make more sense now :)
 
Hi,
Yes, display is much clearer than compare..

Use 2 Date ranges ( 4 prompts )

{?Date Range1} {?Date Range2} {?Upper Date Range1} {Upper Date Range2}
Then in your selection formula:
Code:
(
{COMPLAINT_ISSUE.COMPLETED_DATE} >= {?Date Range1} and {COMPLAINT_ISSUE.COMPLETED_DATE} <= {?Upper Date Range1}
)
OR
(
{COMPLAINT_ISSUE.COMPLETED_DATE} >= {?Date Range2} and {COMPLAINT_ISSUE.COMPLETED_DATE} <= {?Upper Date Range2}
)

If you want all that have a completed_date in either range or change it to AND for those in both ranges ( in case your ranges overlap)




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
thanks!

ok the first case (AND) seems to work fine but it shows all the record together.
As the report is already grouped by department, how can I separate or group by date range1 and date range2?
 
Hi,
Create a formula that tests which range the date falls within and base the Group on that formula.

Example ( sort of):
@DateGroup
Code:
If (
{COMPLAINT_ISSUE.COMPLETED_DATE} >= {?Date Range1} and {COMPLAINT_ISSUE.COMPLETED_DATE} <= {?Upper Date Range1}
)
then 
'Range 1' 
else
If
(
{COMPLAINT_ISSUE.COMPLETED_DATE} >= {?Date Range2} and {COMPLAINT_ISSUE.COMPLETED_DATE} <= {?Upper Date Range2}
)
Then
'Range 2'




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
This seems overly complex with 4 parameters. Why not set up two date parameters, both set to allow date ranges? Then the record selection formula would be:

{COMPLAINT_ISSUE.COMPLETED_DATE} = {?Date Range1} OR
{COMPLAINT_ISSUE.COMPLETED_DATE} = {?Date Range2}

Then you could create two conditional formulas:

//{@daterange1amt}:
if {COMPLAINT_ISSUE.COMPLETED_DATE} = {?Date Range1} then
{table.amt}

//{@daterange2amt}:
if {COMPLAINT_ISSUE.COMPLETED_DATE} = {?Date Range2} then
{table.amt}

Then you can insert summaries on these detail level formulas to use for comparison at the department or report level.

Or you could set up a formula like TurkBear suggests to use in a crosstab as a column field, with amount as the summary field:

if {COMPLAINT_ISSUE.COMPLETED_DATE} = {?Date Range1} then
"Range1" else "Range2"

-LB
 
LOL!
Thanks a million!
This seems to be perfect!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top