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

help on graphing 2 dates, please

Status
Not open for further replies.

demkalt

Technical User
Oct 30, 2001
7
NL
hello,
I have a problem when graphing two dates on 1 graph.
I am using Crystal 8.0.
I have 1 new-time (when something comes in , and one close_time(when the same thing is closed). Now I want to graph them on 1 graph, so that that u can see per month the incoming and closed events on a daterange given by me.
So far I've managed to get only 1 right. So if I do new first it wil display the correct amount per month, and vice versa, but not both. Then it screws up one of them, depending on which formula i use first. These r the formulas i use.
Closed for summing on graph:
- if {HPD:HelpDesk.Status-History.Closed.TIME}>={?begindatum} and {HPD:HelpDesk.Status-History.Closed.TIME}<={?einddatum} and {HPD:HelpDesk.Company/ Organisation}={?klant} then 1 else 0

Incoming for summing on graph:
-if {HPD:HelpDesk.Status-History.New.TIME}>={?begindatum} and {HPD:HelpDesk.Status-History.New.TIME}<={?einddatum} and {HPD:HelpDesk.Company/ Organisation}={?klant}
then 1 else 0

Two Month converters one for incoming, one for closed.
(the if Month {date.table} = 1 then MonthVar := 'Januari')

and the last &quot;On change Of&quot; in the graph.
-WhilePrintingRecords;
if {HPD:HelpDesk.Status-History.Closed.TIME}>={?begindatum}
and {HPD:HelpDesk.Status-History.Closed.TIME}<={?einddatum}
and {HPD:HelpDesk.Company/ Organisation}={?klant}
then {@Periode.Afgesloten.Calls}
else if {HPD:Helpdesk.Status-History.New.TIME}>={?begindatum} and {HPD:HelpDesk.Status-History.New.TIME}<={?einddatum} and {HPD:HelpDesk.Compagny/ Organisation}={?klant} then {@Periode.Binnengekomen.Calls}

Now this wil print Closed event perfectly, but Incoming not.If i print first incoming, then that will be displayed perfectly. Can someone help me, it's getting really frustrating. TIA.
Robert


 
Hi,
you should try to group monthly on the date-field.
If there are two date-fields you have to take in account, try to create a formula that returns the date of the event, like this:
if isnull({HelpDesk.Status-History.Closed.TIME}) then
{HelpDesk.Status-History.New.TIME} else
{HelpDesk.Status-History.Closed.TIME}

Group on this formula.

Then, use the formulas you already have created :
Closed for summing on graph:
- if {HPD:HelpDesk.Status-History.Closed.TIME}>={?begindatum} and {HPD:HelpDesk.Status-History.Closed.TIME}<={?einddatum} and {HPD:HelpDesk.Company/ Organisation}={?klant} then 1 else 0

Incoming for summing on graph:
-if {HPD:HelpDesk.Status-History.New.TIME}>={?begindatum} and {HPD:HelpDesk.Status-History.New.TIME}<={?einddatum} and {HPD:HelpDesk.Company/ Organisation}={?klant}
then 1 else 0


In the graph expert, use the date-formula in On Change of,
and use the Closed and incoming in the sum-field.
This should work.
I haven't used your parameter in the date-formula.

Best regards,
Bjørn
 
Thank you very much, this works briljantly.

Jeeh, it looks so simple now :)

Robert
 
I am sorry. I was to enthousiatic yesterday. I only had
time to check one month, and that was fine. If i take
several months the problem starts again. If take this
formula: if isnull({Closed_TIME}) then {New_TIME}else {Closed_TIME} then it only prints the closed ones fine.
If i turn it around then it prints only the New ones fine.
I am trying to figure out what is wrong, I know it is in the dateformula, but i can't seem to get it right.

Robert.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top