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!

Need to create a looping formula 2 evualate 2 different records

Status
Not open for further replies.

kwr04

Programmer
Jan 15, 2010
11
US
I need 2 evaluate 1 record then 1 or more records depending on number of groups ticket was assigned to. In order to define resolved & assigned ticket counts for certain groups.
First example need to count ticket assinged to abc1 but not resolved by them.
Second example need to just count once for them resolving but not for assigned to them abc1.
I tried several formula's I just cannot determine how to do the loop back to evaluate more than one record.
Any assistance would be greatly appreciated.


Example 1
rec1 ticket# fieldtype ticketstatus assigngrp Pri
HD11111 status Resolved abc16 high

rec2 HD11111 group Assigned abc1 high

rec3 HD11111 group Assigned abc12 high


example 2
rec1 HD22222 status Resolved abc1 high

rec2 HD22222 group Assigned abc1 high
 
One way of doing this is to limit the dataset to those records representing the maximum status per group per ticket. Then you could insert a crosstab for tickets and groups with resolved and assigned as the summaries using conditional formulas, e.g.:

if {%maxstatus} = "Resolved" then 1

You would create a SQL expression {%maxstatus} like this:

(
Select max(`status`)
from table A
where A.`ticketID` = table.`ticketID` and
A.`AssignedGrp` = table.`AssignedGrp`
)

Then in the record selection formula use:

{table.status} = {%maxstatus}

-LB
 
LB
Is there any way I can do this using a loop from header/detail/footer


I did try doing this but my last formula I know does not work and cover evaulation of 2 different records.

in page header -------------------------
forumla resetLow3
Shared NumberVar low_count3 := 1;
low_count3

&
forumla resetLow4
Shared NumberVar low_count4 := 1;
low_count4
-----------------------------------------
Details
formula 1
whileprintingrecords;
Shared NumberVar low_count3;

If
{Priority} = "Low" and
{ticket_status} = "Resolved" and
{@String Ticket} = {ticket_number}and
{field_type} = "Status" and
{assign_group} in ["support group", "abcsupportgrp"]
Then low_count3 := low_count3



whileprintingrecords;
Shared NumberVar low_count5;
//Shared NumberVar low_count4;
Shared StringVar ticket;

If
({Priority} = "Low" and
{ticket_status} = "Assigned" and
{@String Ticket} = {ticket_number}and
{field_type} = "Group" and
{assign_group} in ["supportgrp", "abcsupportgrp"])
Then low_count5 := low_count5


Output1 assigngrp priority ticket_status
1-record supportgrp low resolved (1) formula1
2-record abcgroup low assigned (0) formula2
(0) formula3
output2 other low resolved (0) formula1
supportgrp low assigned (1) formula2
(0) formula3

I was trying to user another formula3 below

whileprintingrecords;
Shared NumberVar low_count6;
Shared StringVar ticket;
If {@String Ticket} = {ticket_number}and
@formula2 = 1 and @formula1 = 1
Then low_count6 := low_count6









 
This looks like it relates to an entirely different thread. Why not try my suggestion?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top