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!

Maximum of maximum

Status
Not open for further replies.

mart1000

MIS
May 23, 2007
39
0
0
GB
I am using CR XI I have some call center data arranged in group hierarchy I want o show the maximum call length and convert to HH MM SS I have no problem with the data and grand total but cant seem to show the max by each group

To prove the figs I have the data and ahave done a max by each group and there is no problem. Its only when I want to convert to the HH MM SS format. It keeps coming up with 'You must have a group that matches this field' - but I have!
Typicall I have formula below :

WhilePrintingRecords;
StringVar Hours1;
StringVar Minutes1;
StringVar Seconds1;
NumberVar maxofmaxansapp;

maxofmaxansapp:=Maximum({dApplicationStat.MaxCallsAnsDelay});

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

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




For the part -> maxofmaxansapp:=Maximum ({dApplicationStat.MaxCallsAnsDelay});

I am trying to put my new group in eg maxofmaxansapp:=Maximum(Maximum ({dApplicationStat.MaxCallsAnsDelay}, {dApplicationStat.Application}));
 
If you want the maximum of a maximum, you would have to set up a variable like this and place it in the application group header or footer:

whileprintingrecords;
NumberVar maxansapp := maximum({dApplicationStat.MaxCallsAnsDelay}, {dApplicationStat.Application});
numbervar maxofmaxansapp;

if maxansapp > maxofmaxansapp then
maxofmaxansapp := maxansapp;

In the report footer, you would then use a formula that converts this variable into a string, using the steps in
faq767-3543. Set dur = maxofmaxansapp.

-LB
 
Not sure I understand your reply

This is what I need :

Report Header maxofthemaxansdelaygrand
Group 1 Header maxansdelayHead1 X
Group 2 Header maxansdelayHead2 X
Group 3 Header (Suppressed)
Data maxansdelay
Group 3 Footer maxansdelayApplication X
Group 2 and 1 (Suppressed)

maxansdelay variable is shown :

WhilePrintingRecords;
StringVar Hours1;
StringVar Minutes1;
StringVar Seconds1;
NumberVar maxansdelay;

maxansdelay:={dApplicationStat.MaxCallsAnsDelay};

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

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

maxofthemaxansdelaygrand variable is shown :

WhilePrintingRecords;
StringVar Hours1;
StringVar Minutes1;
StringVar Seconds1;
NumberVar maxofthemaxansdelaygrand;

maxofthemaxansdelaygrand:=Maximum({dApplicationStat.MaxCallsAnsDelay});

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

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

For all the groups I can create a max (number) by just inserting a max summary but can seem to then convert to the HH MM SS format. I need to create the fields I have highlighted with an X . Can you just take me through one of them one staep at a time please, Im new to this
 
I am unclear on what you are trying to do. I thought you wanted the maximum of the maximum at a specific group level. If you are just trying to display the maximum at a particular level in string form showing hours, minutes, etc., then you need a separate variable for each group level. The maximum at a particular level would be expressed like:

maximum({dApplicationStat.MaxCallsAnsDelay},{table.groupfield})

Use this in the formula for the dur variable in SV's faq. You will have three separate formulas, one for each group maximum.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top