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

Multiples SAVES while looping through arrays

Status
Not open for further replies.

CFDev

Programmer
Joined
Aug 24, 2001
Messages
8
Location
US
I'm trying to do multiple SAVEs while looping throuh an arrays without success. Any help would be appreciated.

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 3.2 Final//EN&quot;>
<HTML>
<HEAD>
<TITLE>PGM Detail Information</TITLE>
</HEAD>
<BODY BGCOLOR=&quot;White&quot; BACKGROUND=&quot;whitext.gif&quot;>
<!--- This parses the performance date that was selected by the user from the previous template. --->
<CFSET parsedPerfDate = ParseDateTime(dateSelected)>
<CFSET ODBCSelectedDate = CreateODBCDateTime(parsedPerfDate)>
<CFSET TotalWeight = 0>
<CFSET SubProcAggregate = 0>
<CFSET #MsurYTD_POG# = 0>
<CFSET MeasureAggregate = 0>
<CFSET #wghtsBeingReported# = 0>


<!--- This gets deliverable and measure information for the Sub-Process ID that has been passed from the previous template. --->
<CFQUERY NAME=&quot;GetDetail&quot; DATASOURCE=&quot;PGM&quot;>
SELECT *
FROM Subprocess,Deliverable,Measure
WHERE (Subprocess.sub_prcs_id = '#SubID#' AND
Subprocess.sub_prcs_fisc_yr = '#cookie.FiscalYear#' AND
Deliverable.sub_prcs_id = '#SubID#' AND
Deliverable.dlvr_fisc_yr = '#cookie.FiscalYear#' AND
Deliverable.dlvr_id = Measure.dlvr_id AND
Measure.msur_fisc_yr = '#cookie.FiscalYear#')
ORDER BY Deliverable.dlvr_name
</CFQUERY>

<CFQUERY NAME=&quot;GetProcess&quot; DATASOURCE=&quot;PGM&quot;>
SELECT prcs_name
FROM Process
WHERE Process.prcs_id = '#ProcessID#' AND
Process.prcs_fisc_yr = '#cookie.FiscalYear#'
</CFQUERY>

<!--- Allocate arrays to hold the deliverable and measure information.msurArray holds dlvr_id, msur_id, and wght.
msurArray2 holds the survey code (either 0 or 1) in position 1.
Position 2 is not currently used.MsrArray holds msur_fmla_oper, expc_perf_amt, and msur_freq. --->
<CFOUTPUT>
<CFSET #recCount# = #GetDetail.RecordCount#>
<CFSET msurArray = ArrayNew(3)>
<CFSET msurArray2 = ArrayNew(2)>
<CFSET MsrArray = ArrayNew(3)>


</CFOUTPUT>
<CFLOOP Query=&quot;GetDetail&quot;
STARTROW=&quot;1&quot;
ENDROW=&quot;#recCount#&quot;>
<CFSET msurArray[CurrentRow][1][1] = GetDetail.dlvr_id[CurrentRow]>
<CFSET msurArray[CurrentRow][1][2] = GetDetail.msur_id[CurrentRow]>
<CFSET MsurArray[CurrentRow][1][3] = GetDetail.wght[CurrentRow]>

<!--- CFSET msurArray2[CurrentRow][1] = GetDetail.survey[CurrentRow] --->
<CFSET msurArray2[CurrentRow][2] = GetDetail.Annual_Sum_Mths[CurrentRow]>
<CFSET MsrArray[CurrentRow][1][1] = GetDetail.msur_fmla_oper[CurrentRow]>
<CFSET MsrArray[CurrentRow][1][2] = GetDetail.expc_perf_amt[CurrentRow]>
<CFSET MsrArray[CurrentRow][1][3] = GetDetail.msur_freq[CurrentRow]>
</CFLOOP>
<!--- Allocate arrays to hold information from the Performance table. perfArray contains the perf_date in position 1 and actl_perf_amt in position 2 from the rows retrieved from &quot;GetPerf&quot;.perfArray2 contains the mth_pog in position 1 and ytd_perf in position 2. perfArray3 contains ytd_pog in position 1 and ignore_month (either Y or N) in position 2. --->
<CFOUTPUT>
<!-- <CFSET perfArray = ArrayNew(2)>
<CFSET perfArray2 = ArrayNew(2)>
<CFSET perfArray3 = ArrayNew(2)> -->

<CFSET perfArray = ArrayNew(2)>

</CFOUTPUT>

<!--- This gets performance information for the measures that were retrieved from &quot;GetDetail&quot;. --->
<CFLOOP Index=&quot;LoopCounter&quot;
From =&quot;1&quot; To=&quot;#recCount#&quot;>
<CFQUERY NAME=&quot;GetPerf&quot; DATASOURCE=&quot;PGM&quot;>
SELECT DISTINCT *
FROM Performance
WHERE Performance.dlvr_id = #msurArray[LoopCounter][1][1]#
AND Performance.msur_id = #msurArray[LoopCounter][1][2]#
AND Performance.perf_date = #ODBCSelectedDate#
</CFQUERY>
<CFSET perfArray[LoopCounter][1]= GetPerf.perf_date>
<CFSET perfArray[LoopCounter][2]= GetPerf.actl_perf_amt>
<CFSET perfArray[LoopCounter][3]= GetPerf.mth_pog>
<CFSET perfArray[LoopCounter][4]= GetPerf.ytd_perf>
<CFSET perfArray[LoopCounter][5]= GetPerf.ytd_pog>
<CFSET perfArray[LoopCounter][6]= GetPerf.ignore_month>
</CFLOOP>

<CFIF #GetDetail.RecordCount# IS 0>
<H3>No records were found matching your criteria
<P>Please make another selection. </H3>
<CFELSE>
<CFOUTPUT>
<TABLE width=&quot;100%&quot; BORDER=&quot;2&quot; BGCOLOR=&quot;FFFFCC&quot;>
<TR>
<TD align=&quot;left&quot;><B><font face=&quot;MS Sans Serif&quot; size=&quot;4&quot;>#GetProcess.prcs_name# </FONT></B></TD>
<TD align=&quot;center&quot;><B><FONT size=&quot;4&quot; FACE=&quot;MS SANS SERIF&quot;>#GetDetail.sub_prcs_id#  #GetDetail.sub_prcs_name#</FONT></B></TD>
<TD align=&quot;right&quot;><B><FONT size=&quot;4&quot; FACE=&quot;MS SANS SERIF&quot;>As of:  #dateselected# </FONT></B></TD>
</tr>
</TABLE>
</CFOUTPUT>
<TABLE BORDER=2 width=&quot;100%&quot; ALIGN=&quot;CENTER&quot;>
<TR ALIGN=&quot;CENTER&quot;>
<TH width=50 BGCOLOR=&quot;006666&quot;><FONT FACE=&quot;MS SANS SERIF&quot; SIZE=&quot;-2&quot; COLOR=&quot;Yellow&quot;>Deliverable</FONT></TH>
<TH width=50 BGCOLOR=&quot;006666&quot;><FONT FACE=&quot;MS SANS SERIF&quot; SIZE=&quot;-2&quot; COLOR=&quot;Yellow&quot;>Measure</FONT></TH>
<TH width=30 BGCOLOR=&quot;006666&quot;><FONT FACE=&quot;MS SANS SERIF&quot; SIZE=&quot;-2&quot; COLOR=&quot;Yellow&quot;>Wght</FONT></TH>
<TH width=55 BGCOLOR=&quot;006666&quot;><FONT FACE=&quot;MS SANS SERIF&quot; SIZE=&quot;-2&quot; COLOR=&quot;Yellow&quot;>Compare</FONT></TH>
<TH width=40 BGCOLOR=&quot;006666&quot;><FONT FACE=&quot;MS SANS SERIF&quot; SIZE=&quot;-2&quot; COLOR=&quot;Yellow&quot;>Annual Target</FONT></TH>
<TH width=10 BGCOLOR=&quot;006666&quot;><FONT FACE=&quot;MS SANS SERIF&quot; SIZE=&quot;-2&quot; COLOR=&quot;Yellow&quot;>Bypass Month</FONT></TH>
<TH width=50 BGCOLOR=&quot;006666&quot;><FONT FACE=&quot;MS SANS SERIF&quot; SIZE=&quot;-2&quot; COLOR=&quot;Yellow&quot;>Monthly Performance</FONT></TH>
<TH width=50 BGCOLOR=&quot;006666&quot;><FONT FACE=&quot;MS SANS SERIF&quot; SIZE=&quot;-2&quot; COLOR=&quot;Yellow&quot;>Mthly % Goal</FONT></TH>
<TH width=50 BGCOLOR=&quot;006666&quot;><FONT FACE=&quot;MS SANS SERIF&quot; SIZE=&quot;-2&quot; COLOR=&quot;Yellow&quot;>YTD Performance</FONT></TH>
<TH width=50 BGCOLOR=&quot;006666&quot;><FONT FACE=&quot;MS SANS SERIF&quot; SIZE=&quot;-2&quot; COLOR=&quot;Yellow&quot;>YTD % Goal</FONT></TH>

<!--- TGDDH, WIR#07330: Action column no longer necessary w/ one SAVE. --->
<!--- <TH width=50 BGCOLOR=&quot;006666&quot; colspan=2><FONT FACE=&quot;MS SANS SERIF&quot; SIZE=&quot;-2&quot; COLOR=&quot;Yellow&quot;>Action</FONT></TH> --->
</tr>
<CFSET loopcounter = 1>

<FORM ACTION=&quot;UpdatePerf.cfm&quot; METHOD=&quot;POST&quot;>

<CFOUTPUT QUERY=&quot;GetDetail&quot;>
<!--- Convert Formula Operator code to an understandable value for display --->
<CFSET #vmsur_fmla_oper# = #msur_fmla_oper#>
<CFIF trim(#msur_fmla_oper#) IS &quot;>&quot;>
<CFSET vmsur_fmla_oper = &quot;Greater than&quot;>
<CFELSEIF trim(#msur_fmla_oper#) IS &quot;<&quot;>
<CFSET vmsur_fmla_oper = &quot;Less than&quot;>
<CFELSEIF trim(#msur_fmla_oper#) IS &quot;=&quot;>
<CFSET vmsur_fmla_oper = &quot;Equal to&quot;>
<CFELSEIF trim(#msur_fmla_oper#) IS &quot;>=&quot;>
<CFSET vmsur_fmla_oper = &quot;Equal or greater&quot;>
<CFELSEIF trim(#msur_fmla_oper#) IS &quot;<=&quot;>
<CFSET vmsur_fmla_oper = &quot;Equal or less&quot;>
</CFIF>
<!--- Convert Measurement Frequency code to an understandable value for display --->
<CFSET #vmsur_freq# = #msur_freq#>
<CFIF #msur_freq# IS &quot;a&quot;>
<CFSET vmsur_freq = &quot;Annual Average&quot;>
<CFELSEIF #msur_freq# IS &quot;b&quot;>
<CFSET vmsur_freq = &quot;Annual Sum&quot;>
<CFELSEIF #msur_freq# IS &quot;s&quot;>
<CFSET vmsur_freq = &quot;Semi-Annual Average&quot;>
<CFELSEIF #msur_freq# IS &quot;d&quot;>
<CFSET vmsur_freq = &quot;Semi-Annual Sum&quot;>
<CFELSEIF #msur_freq# IS &quot;m&quot;>
<CFSET vmsur_freq = &quot;Monthly&quot;>
<CFELSEIF #msur_freq# IS &quot;q&quot;>
<CFSET vmsur_freq = &quot;Quarterly Average&quot;>
<CFELSEIF #msur_freq# IS &quot;f&quot;>
<CFSET vmsur_freq = &quot;Quarterly Sum&quot;>
</CFIF>
<!--- Convert Measurement Type code to an understandable value for display --->
<CFSET #vmsur_type# = #msur_type#>
<CFIF #msur_type# IS &quot;a&quot;>
<CFSET vmsur_type = &quot;Efficient&quot;>
<CFELSEIF #msur_type# IS &quot;b&quot;>
<CFSET vmsur_type = &quot;Effective&quot;>
</CFIF>
<!--- Create TABLE of Deliverable, Performance and Measure Information --->
<!--- TGDDH, WIR#07330: Form moved outside the query so that one SAVE works ---> <!--- <FORM ACTION=UpdatePerf.cfm METHOD=&quot;POST&quot;> --->
<!--- FORM NAME=&quot;EditInput&quot; method=&quot;get&quot; onSubmit=&quot;return EditPerf()&quot; ACTION=UpdatePerf.cfm --->

<!--- CENTER--->
<!--- Hidden fields for entering additional information about the submission --->

<!--- INPUT TYPE=&quot;hidden&quot; NAME=&quot;subid&quot; VALUE=&quot;#cookie.SubID#&quot;--->

<INPUT TYPE=&quot;hidden&quot; NAME=&quot;dlvr_id&quot; VALUE=&quot;#msurArray[LoopCounter][1][1]#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;msur_id&quot; VALUE=&quot;#msurArray[LoopCounter][1][2]#&quot;>
<!--- INPUT TYPE=&quot;hidden&quot; NAME=&quot;survey&quot; VALUE=&quot;#msurArray2[LoopCounter][1]#&quot;--->
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;ignore_month&quot; VALUE=&quot;#perfArray[LoopCounter][6]#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;perf_date&quot; VALUE=&quot;#perfArray[LoopCounter][1]#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;mth_pog&quot; VALUE=&quot;#perfArray[LoopCounter][3]#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;msur_fmla_oper&quot; VALUE=&quot;#MsrArray[LoopCounter][1][1]#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;expc_perf_amt&quot; VALUE=&quot;#MsrArray[LoopCounter][1][2]#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;msur_freq&quot; VALUE=&quot;#MsrArray[LoopCounter][1][3]#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;ytd_perf&quot;
VALUE=&quot;#perfArray[LoopCounter][4]#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;ytd_pog&quot;
VALUE=&quot;#perfArray[LoopCounter][5]#&quot;>

<CFIF (CurrentRow MOD 2) IS 1>
<TR ALIGN=&quot;CENTER&quot;>
<TD width=50 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#GetDetail.dlvr_name# </FONT></TD>
<TD width=50 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#GetDetail.msur_name# </FONT></TD>
<TD width=30 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#GetDetail.wght# </FONT></TD>
<TD width=25 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#vmsur_fmla_oper# </FONT></TD>
<TD width=50 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#DecimalFormat(GetDetail.expc_perf_amt)# </FONT></TD>

<CFIF #perfArray[LoopCounter][6]# is 'Y'>
<TD width=10 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>
<input type=&quot;checkbox&quot; name=&quot;BypassMthCheck&quot; VALUE=&quot;#LoopCounter#&quot; CHECKED></FONT>
</TD>
<CFELSE>
<TD width=10 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>
<input type=&quot;checkbox&quot; name=&quot;BypassMthCheck&quot; VALUE=&quot;#LoopCounter#&quot;></FONT>
</TD>
</CFIF>
<TD width=55 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>
<INPUT TYPE=&quot;text&quot; NAME=&quot;actl_perf_amt&quot; SIZE=&quot;10&quot; MAXLENGTH=&quot;10&quot; VALUE=&quot;#perfArray[LoopCounter][2]#&quot;></FONT>
</TD>

<!--- <TD width=50><FONT size=&quot;-2&quot; FACE=Arial>#perfArray[LoopCounter][1][3]# </FONT></TD>
<TD width=50><FONT size=&quot;-2&quot; FACE=Arial>#perfArray[LoopCounter][4]# </FONT></TD>
<TD width=50><FONT size=&quot;-2&quot; FACE=Arial>#perfArray[LoopCounter][1][5]# </FONT></TD>
--->

<TD width=50 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#Left(&quot;#perfArray[LoopCounter][3]#&quot;, (Find(&quot;.&quot;, &quot;#perfArray[LoopCounter][3]#&quot;)) + 2)# </FONT></TD>
<TD width=50 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#Left(&quot;#perfArray[LoopCounter][4]#&quot;, (Find(&quot;.&quot;, &quot;#perfArray[LoopCounter][4]#&quot;)) + 4 )# </FONT></TD>
<TD width=50 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#Left(&quot;#perfArray[LoopCounter][5]#&quot;, (Find(&quot;.&quot;, &quot;#perfArray[LoopCounter][5]#&quot;)) + 2)# </FONT></TD>

<!--- TGDDH, WIR#07330: Only one save needed.---> <!--- <TD width=10 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;><INPUT ALIGN=&quot;MIDDLE&quot; TYPE=&quot;submit&quot; VALUE=&quot;Save &quot; SIZE=&quot;40&quot;></FONT></TD>
<TD width=10 bgcolor=&quot;##99CCCC&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;><INPUT ALIGN=&quot;MIDDLE&quot; TYPE=&quot;reset&quot; SIZE=&quot;40&quot; VALUE=&quot; Reset &quot;></FONT></TD>
--->

</TR>
<CFELSE>
<TR ALIGN=&quot;CENTER&quot;>
<TD width=50 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#GetDetail.dlvr_name# </FONT></TD>
<TD width=50 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#GetDetail.msur_name# </FONT></TD>
<TD width=30 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#GetDetail.wght# </FONT></TD>
<TD width=25 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#vmsur_fmla_oper# </FONT></TD>
<TD width=50 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#DecimalFormat(GetDetail.expc_perf_amt)# </FONT></TD>

<CFIF #perfArray[LoopCounter][6]# is 'Y'>
<TD width=10 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>
<input type=&quot;checkbox&quot; name=&quot;BypassMthCheck&quot; VALUE=&quot;#LoopCounter#&quot; CHECKED></FONT>
</TD>
<CFELSE>
<TD width=10 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>
<input type=&quot;checkbox&quot; name=&quot;BypassMthCheck&quot; VALUE=&quot;#LoopCounter#&quot;></FONT>
</TD>
</CFIF>
<TD width=55 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>
<INPUT TYPE=&quot;text&quot; NAME=&quot;actl_perf_amt&quot; SIZE=&quot;10&quot; MAXLENGTH=&quot;10&quot; VALUE=&quot;#perfArray[LoopCounter][2]#&quot;></FONT>
</TD>

<!--- <TD width=50><FONT size=&quot;-2&quot; FACE=Arial>#perfArray[LoopCounter][1][3]# </FONT></TD>
<TD width=50><FONT size=&quot;-2&quot; FACE=Arial>#perfArray[LoopCounter][4]# </FONT></TD>
<TD width=50><FONT size=&quot;-2&quot; FACE=Arial>#perfArray[LoopCounter][1][5]# </FONT></TD>
--->

<TD width=50 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#Left(&quot;#perfArray[LoopCounter][3]#&quot;, (Find(&quot;.&quot;, &quot;#perfArray[LoopCounter][3]#&quot;)) + 2)# </FONT></TD>
<TD width=50 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#Left(&quot;#perfArray[LoopCounter][4]#&quot;, (Find(&quot;.&quot;, &quot;#perfArray[LoopCounter][4]#&quot;)) + 4 )# </FONT></TD>
<TD width=50 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;>#Left(&quot;#perfArray[LoopCounter][5]#&quot;, (Find(&quot;.&quot;, &quot;#perfArray[LoopCounter][5]#&quot;)) + 2)# </FONT></TD>

<!--- TGDDH, WIR#07330: Only one SAVE needed. ---> <!--- <TD width=10 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;><INPUT ALIGN=&quot;MIDDLE&quot; TYPE=&quot;submit&quot; VALUE=&quot;Save &quot; SIZE=&quot;40&quot;></FONT></TD>
<TD width=10 bgcolor=&quot;White&quot;><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;><INPUT ALIGN=&quot;MIDDLE&quot; TYPE=&quot;reset&quot; SIZE=&quot;40&quot; VALUE=&quot; Reset &quot;></FONT></TD> --->
</TR>
</CFIF>
<!--- We total the weights of only those measures that are being reported for the month. If Bypass Month is checked, we don't include that measure's weight in our total unless there is a YTD percent of goal from a prior month. --->

<CFIF (#perfArray[LoopCounter][6]# IS 'N') OR
(#perfArray[LoopCounter][6]# is 'Y' AND #perfArray[LoopCounter][5]# IS NOT 0)>
<CFSET #wghtsBeingReported# = #wghtsBeingReported# + #MsurArray[LoopCounter][1][3]#>
</CFIF>

<CFSET LoopCounter = #LoopCounter# + 1>
<CFSET TotalWeight = #TotalWeight# + #GetDetail.wght#>
</CFOUTPUT>
</TABLE>

<TABLE width=&quot;100%&quot;>
<TD width=450><TH width=50><FONT size=&quot;-3&quot; FACE=&quot;MS Sans Serif&quot;><TD WIDTH=&quot;40&quot;><FONT SIZE=&quot;-3&quot; FACE=&quot;Arial&quot;><INPUT TYPE=&quot;submit&quot; ALIGN=&quot;RIGHT&quot; SIZE=&quot;20&quot; NAME=&quot;Selection&quot; VALUE=&quot;Save&quot;></FONT></TD>
<TD WIDTH=&quot;40&quot;><FONT SIZE=&quot;-3&quot; FACE=&quot;Arial&quot;><INPUT TYPE=&quot;reset&quot; ALIGN=&quot;RIGHT&quot; SIZE=&quot;20&quot; NAME=&quot;Selection&quot; VALUE=&quot;Reset&quot;></FONT></TD>
<cfoutput>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;FormRecCount&quot; VALUE=&quot;#recCount#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;subid&quot; VALUE=&quot;#SubID#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;ProcessID&quot; VALUE=&quot;#ProcessID#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;dateSelected&quot; VALUE=&quot;#dateSelected#&quot;>
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;ODBCSelectedDate&quot; VALUE=&quot;#ODBCSelectedDate#&quot;>
</cfoutput>
</FORM>

<CFLOOP Index=&quot;LoopCounter&quot;
FROM =&quot;1&quot; To=&quot;#recCount#&quot;>

<!--- Calculate Subprocess Aggregate amount. --->
<CFIF (#perfArray[LoopCounter][6]# is 'N') OR
(#perfArray[LoopCounter][6]# is 'Y' AND #perfArray[LoopCounter][5]# IS NOT 0)>
<CFIF #MsurArray[LoopCounter][1][3]# GREATER THAN 0 AND #perfArray[LoopCounter][5]# GREATER THAN 0>
<CFSET #MsurYTD_POG# = #perfArray[LoopCounter][5]#>
<CFIF #MsurYTD_POG# GREATER THAN 125>
<CFSET #MsurYTD_POG# = 125>
</CFIF>

<CFSET MeasureAggregate = #MsurArray[LoopCounter][1][3]# / #wghtsBeingReported# * #MsurYTD_POG#>

<!--- CFSET MeasureAggregate = (#GetDetail.wght# * #PercentageYTD_POG#)>
<CFSET MeasureAggregate = #MeasureAggregate# / 100 ---> <!--- Make sure we truncate and not round --->
<CFSET decPoint = #FindOneOf(&quot;.&quot;, &quot;#MeasureAggregate#&quot;)#>
<!--- look for a decimal point --->
<CFIF #decPoint# GT 0>
<CFSET MeasureAggregate = #Left(&quot;#MeasureAggregate#&quot;, (Find(&quot;.&quot;, &quot;#MeasureAggregate#&quot;)) + 4)#>
</CFIF>
<CFSET SubProcAggregate = #SubProcAggregate# + #MeasureAggregate#>
</CFIF>
<!--- CFSET LoopCounter = #LoopCounter# + 1>
<CFSET TotalWeight = #TotalWeight# + #GetDetail.wght# --->
</CFIF>
</CFLOOP>

<!--- Included Template: RollUpLevelOne.cfm
Purpose: This template is used to sum the weight values for a given Sub-process to verify they add to 100. If they don't a javascript alert is generated to inform the user to adjust the weighting factors.

Included Template: CheckTotalWeightJS.cfm
Purpose: This template is used to verify that the measure weights sum to 100. If not,a javascript alert message is displayed --->
<CFINCLUDE TEMPLATE=&quot;RollUpLevelOne.cfm&quot;>
<CFINCLUDE TEMPLATE=&quot;CheckTotalWeightJS.cfm&quot;>

<BR>  <FONT COLOR=&quot;Red&quot;><STRONG>Procedures for Updating Performance Information:</STRONG></FONT>
<OL TYPE=&quot;1&quot;>
<LI>Update the Monthly Performance amount for the measure(s).
<LI>Click the <B>Save</B> button.
</OL>
</CFIF>


</BODY>
</HTML>




xxxxxxxxxxxx
ACTION PAGE:
<!--------------------------------------------------------------------------
This updates the monthly performance amount (actl_perf_amt) for the month
that has been selected. It calls CalcPGM which calls the appropriate
template to calculate the monthly % of goal, YTD performance, and YTD % of
goal depending on the msur_freq. If a performance record for the selected
month does not exist, we have to insert one first. Otherwise, we just
update the existing one.
--------------------------------------------------------------------------->
<CFLOOP Index=&quot;LoopCounter&quot;
FROM =&quot;1&quot; To=&quot;#FormRecCount#&quot;>

<CFIF ListContains(BypassMthCheck, LoopCounter, &quot;,&quot;) IS 0>
<CFSET ignore_month = &quot;N&quot;>
<CFSET msur_actl_perf_amt = #ListGetAt(actl_perf_amt, LoopCounter)#>
<CFELSE>
<CFSET ignore_month = &quot;Y&quot;>
<CFSET msur_actl_perf_amt = 0>
</CFIF>


<!--------------------------------------------------------------------------
See if there is a performance record for the month selected.
--->

<CFSET LoopCounter = 1>

<CFQUERY NAME=&quot;GetPerf&quot; DATASOURCE=&quot;PGM&quot;>
SELECT *
FROM Performance
WHERE Performance.dlvr_id = #ListGetAt(dlvr_id, LoopCounter)#
AND Performance.msur_id = #ListGetAt(msur_id, LoopCounter)#
AND Performance.perf_date = #ODBCSelectedDate#
</CFQUERY>

<CFTRANSACTION>
<CFIF #GetPerf.RecordCount# IS 0>
<CFQUERY NAME=&quot;InsertPerf&quot; DATASOURCE=&quot;PGM&quot;>
INSERT INTO Performance(perf_date, actl_perf_amt, dlvr_id, msur_id, ignore_month)
VALUES (#ODBCSelectedDate#, #msur_actl_perf_amt#, #ListGetAt(dlvr_id, LoopCounter)#, #ListGetAt(msur_id, LoopCounter)#, '#ListGetAt(ignore_month, LoopCounter)#')
</CFQUERY>
<CFELSE>
<CFQUERY NAME=&quot;UpdtPerf&quot; DATASOURCE=&quot;PGM&quot;>
UPDATE Performance
SET actl_perf_amt = #msur_actl_perf_amt#,
ignore_month = '#ListGetAt(ignore_month, LoopCounter)#'
WHERE dlvr_id = #ListGetAt(dlvr_id, LoopCounter)#
AND msur_id = #ListGetAt(msur_id, LoopCounter)#
AND perf_date = '#ListGetAt(perf_date, LoopCounter)#'
</CFQUERY>
</CFIF>

<CFSET Vmsur_freq = #msur_freq#>
<CFSET mth_pog = 0>
<CFSET ytd_pog = 0>
<CFSET ytd_perf = 0>

<CFINCLUDE TEMPLATE=&quot;CalcPGM.cfm&quot;>


<CFQUERY NAME=&quot;UpdtPerf&quot; DATASOURCE=&quot;PGM&quot;>
UPDATE Performance
SET mth_pog = #ListGetAt(mth_pog, LoopCounter)#,
ytd_perf = #ListGetAt(ytd_perf, LoopCounter)#,
ytd_pog = #ListGetAt(ytd_pog, LoopCounter)#
WHERE dlvr_id = #ListGetAt(dlvr_id, LoopCounter)#
AND msur_id = #ListGetAt(msur_id, LoopCounter)#
AND perf_date = #ODBCSelectedDate#
</CFQUERY>

</CFTRANSACTION>
</CFLOOP>
<CFINCLUDE TEMPLATE=&quot;UpdateDetail.cfm&quot;>



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top