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

Cross tab and charts

Status
Not open for further replies.

ptrifile

Technical User
Aug 10, 2004
457
US
Can someone please tell me why the following formula field is unavailable for use in a cross tab or a chart? Also, is there a way for it to be changed so it is available? Thanks for any help or suggestions!

Code:
WhilePrintingRecords;
StringVar Hours1;
StringVar Minutes1;
StringVar Seconds1;
NumberVar avgtalktime;


avgtalktime:= if {wAgentBySkillsetStat.CallsAnswered} = 0 then 0 else
Sum ({wAgentBySkillsetStat.TalkTime}, {wAgentBySkillsetStat.Timestamp}, "weekly")/Sum ({wAgentBySkillsetStat.CallsAnswered}, {wAgentBySkillsetStat.Timestamp}, "weekly");

If avgtalktime < 0 Then
  "Cannot have a time less than zero"
Else
  (Hours1:=ToText(Truncate(avgtalktime/3600),0);
  Minutes1:=ToText(Truncate(Remainder(avgtalktime,3600)/60),0);
  Seconds1:=ToText(Remainder(Remainder(avgtalktime,3600),60),0));

//Display the time formated.
  (if length(Hours1) < 2 then '0') + Hours1 + ":" +
  ["0",""][length(Minutes1)] + Minutes1 + ":" +
 ["0",""][length(Seconds1)] + Seconds1

Thank you!

Paul
 
You can not use while printing or variable formulas in cross tabs or charts.

You should be able to chart on a formula which contained only this

if {wAgentBySkillsetStat.CallsAnswered} = 0 then 0 else
Sum ({wAgentBySkillsetStat.TalkTime}, {wAgentBySkillsetStat.Timestamp}, "weekly")/Sum ({wAgentBySkillsetStat.CallsAnswered}, {wAgentBySkillsetStat.Timestamp}, "weekly");

Ian
 
Thanks Ian, that works but then obviously I lose the conversion to HH:MM:SS and just show number of Seconds. Is there any workaround so that i can show it in the HH:MM:SS on a chart or cross tab?

Thanks again!

Paul
 
In a crosstab, you can select the summary in preview mode->format field->display string and use the x+2 formula are to convert the result to a string.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top