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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculated Formula cant be put in graph. - revisited

Status
Not open for further replies.

cheerfulskeptic

Programmer
Feb 3, 2003
88
IN
OK, I still havent managed to get this off the ground, and since ive only been using CR8 for a few months, its hard for me - I aplogize to everyone for being such a pain, and thanks to those who put up with me.
here's the situation

I need a graph with 8 points on the X-axis (ie, 1 point for each quarter in the year preceding to the current quarter or a quarter specified). For example, if I specify parameters of Q2 2003, it should show on the graph Q2 '03, Q1 '03, Q1-Q4 of 2002, and then Q3-Q4 of 2001.) and so on.
and then plot the occurences (count of a field) for each Quarter on the Y-axes.
Is this possible? or am I doomed?
Thanks again!
 
Sounds doable.

The chart is very simple, just select the date in the On Change Of and select the Order button->Chart Values Shown For Each Quarter.

I assume that by specifying Q2 2003 you mean to use a parameter which asks for the quarternumber and the year.

I would use 2 parameters here, one for the quarter, and one for the year, it's less likely that they will have data entry problems in this case, but you could always prepopulate the parameter too.

In your record selection formula:

datepart("q",{Orders.Order Date}) = {?quarterparm}
and
datepart("yyyy",{Orders.Order Date}) = {?yearparm}

-k
 
yes I have 2 parameters. the chart shows up fiune, but only goes back over 4 quarters. How do I get the last 8 quarters to show up?
I was thinking of formulas for each quarter called
Q1_Currentyear - Q4_Currentyear
Q1_Lastyear - Q4_Lastyear
etc.
 
Create dates from the parameters in formulas, and use the datediff function to get a start date from that, as in:

@startdate
if 1 = 1 then //replace the first 1 with your quarter parm
dateadd ("q",-8,cdate(2000,1,31)) //Replace 2000 with your year parm
else
if 1 = 2 then //replace the first 1 with your quarter parm
dateadd ("q",-8,cdate(2000,4,1)) //Replace 2000 with your year parm
else
if 1 = 3 then //replace the first 1 with your quarter parm
dateadd ("q",-8,cdate(2000,7,1)) //Replace 2000 with your year parm
else
if 1 = 4 then //replace the first 1 with your quarter parm
dateadd ("q",-8,cdate(2000,10,1)) //Replace 2000 with your year parm

@enddate
if 1 = 1 then //replace the first 1 with your quarter parm
cdate(2000,3,31) //Replace 2000 with your year parm
else
if 1 = 2 then //replace the first 1 with your quarter parm
cdate(2000,6,30) //Replace 2000 with your year parm
else
if 1 = 3 then //replace the first 1 with your quarter parm
cdate(2000,9,30)) //Replace 2000 with your year parm
else
if 1 = 4 then //replace the first 1 with your quarter parm
cdate(2000,12,31)) //Replace 2000 with your year parm


Now in the reocrd selection formula use:

{table.date} >= @startdate
and
{table.date} <= @enddate

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top