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

Multiple if/then statements 1

Status
Not open for further replies.

Parkypark

IS-IT--Management
Jan 6, 2003
43
GB
I am having a bit of a block here
I need to write an if then formula (Which is easy, and I can do) but my problem is that there are multiple if thens within 1 perameter

eg
if {vect_ansprfle.calltypename}='MRC'and {vect_ansprfle.queuetime}> 10 then 0
else 1
this works a treat
and i can tell if a call take more than 10 secs or less so pass or fail accordingly

the problem is for some calls there are multiple targets, and this is what i cant do
I need to know how may calls were answered in 10 seconds, 20 seconds, 40 seconds and 60 seconds for the same contract.

My solution at the mo is to write 4 seperate reports.

please help before i loose whats left of my hair over this
ta
 
By the way I could do this in Excel, but thats not the point.
cheers
and thanks in advance for any help
 
Can you group by vect_ansprfle.queuetime and choose a specified order - your group names would then be <10s, 10-20s etc?
 
formula named callresponsetime in the detail line:

if {vect_ansprfle.queuetime} < 10 then 10
else
if {vect_ansprfle.queuetime} > 10 and {vect_ansprfle.queuetime} < 20 then 20
else
if {vect_ansprfle.queuetime} > 10 and {vect_ansprfle.queuetime} < 20 then 20
else
if {vect_ansprfle.queuetime} > 20 and {vect_ansprfle.queuetime} < 40 then 40
else
if {vect_ansprfle.queuetime} > 40 and {vect_ansprfle.queuetime} < 60 then 60

formula named countcalls in detail line to count calls:
whileprintingrecords;
shared numbervar tenseccount;
shared numbervar twentyseccount;
shared numbervar fortyseccount;
shared numbervar sixtyseccount;
select callresponsetime
case 10 : tennseccount := tennseccount + 1
case 20 : twentyseccount := twentyseccount + 1
case 40 : fortyseccount := fortyseccount + 1
case 60 : sixtyseccount := sixtyseccount + 1

formula in total line to show 10 sec total:
whileprintingrecords;
shared numbervar tennseccount;
tennseccount

formula in total line to show 20 sec total:
whileprintingrecords;
shared numbervar twentyseccount;
twentyseccount

formula in total line to show 40 sec total:
whileprintingrecords;
shared numbervar fortyseccount;
fortyseccount

formula in total line to show 60 sec total:
whileprintingrecords;
shared numbervar sixtyseccount;
sixtyseccount

formula in total line to clear counters:
(put this one after the ones to display the counts)
whileprintingrecords;
shared numbervar tennseccount := 0;
shared numbervar twentyseccount := 0;
shared numbervar fortyseccount := 0;
shared numbervar sixtyseccount := 0;




 
That is amazing
my thanks to MColeman
You are a star
worked first time
my own testing was close to that initially but the counts are a dream come true

Is there a way to combine 3 different clients onto this report

cheers
Richard

 
is this correct then to add five seconds to the mix
if {vect_ansprfle.queuetime} < 5 then 5
else
if {vect_ansprfle.queuetime} > 5 and {vect_ansprfle.queuetime} < 10 then 10
else
if {vect_ansprfle.queuetime} > 10 and {vect_ansprfle.queuetime} < 20 then 20
else
if {vect_ansprfle.queuetime} > 10 and {vect_ansprfle.queuetime} < 20 then 20
else
if {vect_ansprfle.queuetime} > 20 and {vect_ansprfle.queuetime} < 40 then 40
else
if {vect_ansprfle.queuetime} > 40 and {vect_ansprfle.queuetime} < 60 then 60

and
whileprintingrecords;
shared numbervar fiveseccount;
shared numbervar tenseccount;
shared numbervar twentyseccount;
shared numbervar fortyseccount;
shared numbervar sixtyseccount;
select {@callresponsetime}
case 5 : fiveseccount := fiveseccount + 1
case 10 : tenseccount := tenseccount + 1
case 20 : twentyseccount := twentyseccount + 1
case 40 : fortyseccount := fortyseccount + 1
case 60 : sixtyseccount := sixtyseccount + 1

etc etc

cos im getting 0 returned for 5 secs only

im must be missing something
 
I would make the formula a little simpler....since each IF-Then block is evaluated in order then there is no reason to have a multiple test.

is this correct then to add five seconds to the mix
if {vect_ansprfle.queuetime} <= 5 then 5
else
if {vect_ansprfle.queuetime} <= 10 then 10
else
if {vect_ansprfle.queuetime} <= 20 then 20
else
if {vect_ansprfle.queuetime} <= 40 then 40
else
if {vect_ansprfle.queuetime} <= 60 then 60

and
whileprintingrecords;
shared numbervar fiveseccount;
shared numbervar tenseccount;
shared numbervar twentyseccount;
shared numbervar fortyseccount;
shared numbervar sixtyseccount;
select {@callresponsetime}
case 5 : fiveseccount := fiveseccount + 1
case 10 : tenseccount := tenseccount + 1
case 20 : twentyseccount := twentyseccount + 1
case 40 : fortyseccount := fortyseccount + 1
case 60 : sixtyseccount := sixtyseccount + 1


Your other problem was you were using < 5 not <= 5

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top