ACOGS1	Adj'd Cogs [0]	@if(flgadjtype=1,acogsin1,@if(flgadjtype=2,acogsmaq1,acogsout1))
ACOGS2	Adj'd Cogs [-1]	@if(flgadjtype=1,acogsin2,@if(flgadjtype=2,acogsmaq2,acogsout2))
ACOGS3	Adj'd Cogs [-2]	@if(flgadjtype=1,acogsin3,@if(flgadjtype=2,acogsmaq3,acogsout3))
ACOGS4	Adj'd Cogs [-3]	@if(flgadjtype=1,acogsin4,@if(flgadjtype=2,acogsmaq4,acogsout4))
ACOGS5	Adj'd Cogs [-4]	@if(flgadjtype=1,acogsin5,@if(flgadjtype=2,acogsmaq5,acogsout5))
ACOGSIN1	Adj. Cogs [0] inbound	((cogs-lifrdif)+(ap1*sale-apav)*int1/(1+int1*apav/(cogs-lifrdif))-(invt1*sale-invtav-lifrav)*int1)[0]
ACOGSIN2	Adj. Cogs [-1] inbound	((cogs-lifrdif)+(ap2*sale-apav)*int2/(1+int2*apav/(cogs-lifrdif))-(invt2*sale-invtav-lifrav)*int2)[-1]
ACOGSIN3	Adj. Cogs [-2] inbound	((cogs-lifrdif)+(ap3*sale-apav)*int3/(1+int3*apav/(cogs-lifrdif))-(invt3*sale-invtav-lifrav)*int3)[-2]
ACOGSIN4	Adj. Cogs [-3] inbound	((cogs-lifrdif)+(ap4*sale-apav)*int4/(1+int4*apav/(cogs-lifrdif))-(invt4*sale-invtav-lifrav)*int4)[-3]
ACOGSIN5	Adj. Cogs [-4] inbound	((cogs-lifrdif)+(ap5*sale-apav)*int5/(1+int5*apav/(cogs-lifrdif))-(invt5*sale-invtav-lifrav)*int5)[-4]
ACOGSMAQ1	Adj. Cogs [0] maquiladora	((cogs-lifrdif)+(ap1*(cogs-lifrdif+opexpse)-apav)*int1/(1+int1*apav/(cogs-lifrdif))-(invt1*(cogs-lifrdif+opexpse)-invtav-lifrav)*int1)[0]
ACOGSMAQ2	Adj. Cogs [-1] maquiladora	((cogs-lifrdif)+(ap2*(cogs-lifrdif+opexpse)-apav)*int2/(1+int2*apav/(cogs-lifrdif))-(invt2*(cogs-lifrdif+opexpse)-invtav-lifrav)*int2)[-1]
ACOGSMAQ3	Adj. Cogs [-2] maquiladora	((cogs-lifrdif)+(ap3*(cogs-lifrdif+opexpse)-apav)*int3/(1+int3*apav/(cogs-lifrdif))-(invt3*(cogs-lifrdif+opexpse)-invtav-lifrav)*int3)[-2]
ACOGSMAQ4	Adj. Cogs [-3] maquiladora	((cogs-lifrdif)+(ap4*(cogs-lifrdif+opexpse)-apav)*int4/(1+int4*apav/(cogs-lifrdif))-(invt4*(cogs-lifrdif+opexpse)-invtav-lifrav)*int4)[-3]
ACOGSMAQ5	Adj. Cogs [-4] maquiladora	((cogs-lifrdif)+(ap5*(cogs-lifrdif+opexpse)-apav)*int5/(1+int5*apav/(cogs-lifrdif))-(invt5*(cogs-lifrdif+opexpse)-invtav-lifrav)*int5)[-4]
ACOGSOUT1	Adj. Cogs [0] outbound	((cogs-lifrdif)+(ap1*(cogs-lifrdif)-apav)*int1/(1+int1*apav/(cogs-lifrdif))-(invt1*(cogs-lifrdif)-invtav-lifrav)*int1)[0]
ACOGSOUT2	Adj. Cogs [-1] outbound	((cogs-lifrdif)+(ap2*(cogs-lifrdif)-apav)*int2/(1+int2*apav/(cogs-lifrdif))-(invt2*(cogs-lifrdif)-invtav-lifrav)*int2)[-1]
ACOGSOUT3	Adj. Cogs [-2] outbound	((cogs-lifrdif)+(ap3*(cogs-lifrdif)-apav)*int3/(1+int3*apav/(cogs-lifrdif))-(invt3*(cogs-lifrdif)-invtav-lifrav)*int3)[-2]
ACOGSOUT4	Adj. Cogs [-3] outbound	((cogs-lifrdif)+(ap4*(cogs-lifrdif)-apav)*int4/(1+int4*apav/(cogs-lifrdif))-(invt4*(cogs-lifrdif)-invtav-lifrav)*int4)[-3]
ACOGSOUT5	Adj. Cogs [-4] outbound	((cogs-lifrdif)+(ap5*(cogs-lifrdif)-apav)*int5/(1+int5*apav/(cogs-lifrdif))-(invt5*(cogs-lifrdif)-invtav-lifrav)*int5)[-4]
ACOGSYA1	Adj'd Cogs YA [0]	@if(compyradj=0,acogs1,acogs1[-1])
ACOGSYA2	Adj'd Cogs YA [-1]	@if(compyradj=0,acogs2,acogs2[-1])
ACOGSYA3	Adj'd Cogs YA [-2]	@if(compyradj=0,acogs3,acogs3[-1])
ACOGSYA4	Adj'd Cogs YA [-3]	@if(compyradj=0,acogs4,acogs4[-1])
ACOGSYA5	Adj'd Cogs YA [-4]	@if(compyradj=0,acogs5,acogs5[-1])
ADJPLI1	Adjusted PLI [0]	@if(flgadjtype=1,aomin1,@if(flgadjtype=2,amrkmaq1,amrkout1))
ADJPLI2	Adjusted PLI [-1]	@if(flgadjtype=1,aomin2,@if(flgadjtype=2,amrkmaq2,amrkout2))
ADJPLI3	Adjusted PLI [-2]	@if(flgadjtype=1,aomin3,@if(flgadjtype=2,amrkmaq3,amrkout3))
ADJPLI4	Adjusted PLI [-3]	@if(flgadjtype=1,aomin4,@if(flgadjtype=2,amrkmaq4,amrkout4))
ADJPLI5	Adjusted PLI [-4]	@if(flgadjtype=1,aomin5,@if(flgadjtype=2,amrkmaq5,amrkout5))
ADJPLIAVG	1-5 Yr. Wtd. Ave. Adj. PLI	@if(yrsavaila>=yrsreq,(@value(adjpliya1*aweightya1,0)+@if(yrsavg>1,@value(adjpliya2*aweightya2,0),0)+@if(yrsavg>2,@value(adjpliya3*aweightya3,0),0)+@if(yrsavg>3,@value(adjpliya4*aweightya4,0),0)+@if(yrsavg>4,@value(adjpliya5*aweightya5,0),0))/(@value(aweightya1+adjpliya1-adjpliya1,0)+@if(yrsavg>1,@value(aweightya2+adjpliya2-adjpliya2,0),0)+@if(yrsavg>2,@value(aweightya3+adjpliya3-adjpliya3,0),0)+@if(yrsavg>3,@value(aweightya4+adjpliya4-adjpliya4,0),0)+@if(yrsavg>4,@value(aweightya5+adjpliya5-adjpliya5,0),0)),sale[30]+sale[-10])
ADJPLIYA1	Year-aligned ADJPLI1	@if(compyradj=0,adjpli1,adjpli1[-1])
ADJPLIYA2	Year-aligned ADJPLI2	@if(compyradj=0,adjpli2,adjpli2[-1])
ADJPLIYA3	Year-aligned ADJPLI3	@if(compyradj=0,adjpli3,adjpli3[-1])
ADJPLIYA4	Year-aligned ADJPLI4	@if(compyradj=0,adjpli4,adjpli4[-1])
ADJPLIYA5	Year-aligned ADJPLI5	@if(compyradj=0,adjpli5,adjpli5[-1])
ADJTOINV1	Adj. to Inventory [0]	(invt1*denom-invtav-lifrav)
ADJTOINV1YA	Adj. to Inventory YA [0]	@if(compyradj=0,adjtoinv1,adjtoinv1[-1])
ADJTOINV2	Adj. to Inventory [-1]	(invt2*denom-invtav-lifrav)[-1]
ADJTOINV2YA	Adj. to Inventory YA [-1]	@if(compyradj=0,adjtoinv2,adjtoinv2[-1])
ADJTOINV3	Adj. to Inventory [-2]	(invt3*denom-invtav-lifrav)[-2]
ADJTOINV3YA	Adj. to Inventory YA [-2]	@if(compyradj=0,adjtoinv3,adjtoinv3[-1])
ADJTOINV4	Adj. to Inventory [-3]	(invt4*denom-invtav-lifrav)[-3]
ADJTOINV4YA	Adj. to Inventory YA [-3]	@if(compyradj=0,adjtoinv4,adjtoinv4[-1])
ADJTOINV5	Adj. to Inventory [-4]	(invt5*denom-invtav-lifrav)[-4]
ADJTOINV5YA	Adj. to Inventory YA [-4]	@if(compyradj=0,adjtoinv5,adjtoinv5[-1])
ADJTOOOA1	Adj. to OOA [0]	(ooa1*denom-ooaav)
ADJTOOOA1YA	Adj. to OOA YA [0]	@if(compyradj=0,adjtoooa1,adjtoooa1[-1])
ADJTOOOA2	Adj. to OOA [-1]	(ooa2*denom-ooaav)[-1]
ADJTOOOA2YA	Adj. to OOA YA [-1]	@if(compyradj=0,adjtoooa2,adjtoooa2[-1])
ADJTOOOA3	Adj. to OOA [-2]	(ooa3*denom-ooaav)[-2]
ADJTOOOA3YA	Adj. to OOA YA [-2]	@if(compyradj=0,adjtoooa3,adjtoooa3[-1])
ADJTOOOA4	Adj. to OOA [-3]	(ooa4*denom-ooaav)[-3]
ADJTOOOA4YA	Adj. to OOA YA [-3]	@if(compyradj=0,adjtoooa4,adjtoooa4[-1])
ADJTOOOA5	Adj. to OOA [-4]	(ooa5*denom-ooaav)[-4]
ADJTOOOA5YA	Adj. to OOA YA [-4]	@if(compyradj=0,adjtoooa5,adjtoooa5[-1])
ADJTOPAY1	Adj. to Payables [0]	(ap1*denom-apav)
ADJTOPAY1YA	Adj. to Payables YA [0]	@if(compyradj=0,adjtopay1,adjtopay1[-1])
ADJTOPAY2	Adj. to Payables [-1]	(ap2*denom-apav)[-1]
ADJTOPAY2YA	Adj. to Payables YA [-1]	@if(compyradj=0,adjtopay2,adjtopay2[-1])
ADJTOPAY3	Adj. to Payables [-2]	(ap3*denom-apav)[-2]
ADJTOPAY3YA	Adj. to Payables YA [-2]	@if(compyradj=0,adjtopay3,adjtopay3[-1])
ADJTOPAY4	Adj. to Payables [-3]	(ap4*denom-apav)[-3]
ADJTOPAY4YA	Adj. to Payables YA [-3]	@if(compyradj=0,adjtopay4,adjtopay4[-1])
ADJTOPAY5	Adj. to Payables [-4]	(ap5*denom-apav)[-4]
ADJTOPAY5YA	Adj. to Payables YA [-4]	@if(compyradj=0,adjtopay5,adjtopay5[-1])
ADJTOREC1	Adj. to Receivables [0]	(ar1*denom-rectrav)
ADJTOREC1YA	Adj. to Receivables YA [0]	@if(compyradj=0,adjtorec1,adjtorec1[-1])
ADJTOREC2	Adj. to Receivables [-1]	(ar2*denom-rectrav)[-1]
ADJTOREC2YA	Adj. to Receivables YA [-1]	@if(compyradj=0,adjtorec2,adjtorec2[-1])
ADJTOREC3	Adj. to Receivables [-2]	(ar3*denom-rectrav)[-2]
ADJTOREC3YA	Adj. to Receivables YA [-2]	@if(compyradj=0,adjtorec3,adjtorec3[-1])
ADJTOREC4	Adj. to Receivables [-3]	(ar4*denom-rectrav)[-3]
ADJTOREC4YA	Adj. to Receivables YA [-3]	@if(compyradj=0,adjtorec4,adjtorec4[-1])
ADJTOREC5	Adj. to Receivables [-4]	(ar5*denom-rectrav)[-4]
ADJTOREC5YA	Adj. to Receivables YA [-4]	@if(compyradj=0,adjtorec5,adjtorec5[-1])
AMRKMAQ1	Adj. Markup [0] maquiladora	(asalemaq1-acogsmaq1-aoemaq1)/(acogsmaq1+aoemaq1)
AMRKMAQ2	Adj. Markup [-1] maquiladora	(asalemaq2-acogsmaq2-aoemaq2)/(acogsmaq2+aoemaq2)
AMRKMAQ3	Adj. Markup [-2] maquiladora	(asalemaq3-acogsmaq3-aoemaq3)/(acogsmaq3+aoemaq3)
AMRKMAQ4	Adj. Markup [-3] maquiladora	(asalemaq4-acogsmaq4-aoemaq4)/(acogsmaq4+aoemaq4)
AMRKMAQ5	Adj. Markup [-4] maquiladora	(asalemaq5-acogsmaq5-aoemaq5)/(acogsmaq5+aoemaq5)
AMRKOUT1	Adj. Markup [0] outbound	(asaleout1-acogsout1-aoeout1)/(acogsout1+aoeout1)
AMRKOUT2	Adj. Markup [-1] outbound	(asaleout2-acogsout2-aoeout2)/(acogsout2+aoeout2)
AMRKOUT3	Adj. Markup [-2] outbound	(asaleout3-acogsout3-aoeout3)/(acogsout3+aoeout3)
AMRKOUT4	Adj. Markup [-3] outbound	(asaleout4-acogsout4-aoeout4)/(acogsout4+aoeout4)
AMRKOUT5	Adj. Markup [-4] outbound	(asaleout5-acogsout5-aoeout5)/(acogsout5+aoeout5)
AOE1	Adj'd Op. Exp. [0]	@if(flgadjtype=1,aoein1,@if(flgadjtype=2,aoemaq1,aoeout1))
AOE2	Adj'd Op. Exp. [-1]	@if(flgadjtype=1,aoein2,@if(flgadjtype=2,aoemaq2,aoeout2))
AOE3	Adj'd Op. Exp. [-2]	@if(flgadjtype=1,aoein3,@if(flgadjtype=2,aoemaq3,aoeout3))
AOE4	Adj'd Op. Exp. [-3]	@if(flgadjtype=1,aoein4,@if(flgadjtype=2,aoemaq4,aoeout4))
AOE5	Adj'd Op. Exp. [-4]	@if(flgadjtype=1,aoein5,@if(flgadjtype=2,aoemaq5,aoeout5))
AOEIN1	Adj. OE [0] inbound	(opexpse-@if(flgdoooa=1,(ooa1*sale-ooaav)*int1,0))[0]
AOEIN2	Adj. OE [-1] inbound	(opexpse-@if(flgdoooa=1,(ooa2*sale-ooaav)*int2,0))[-1]
AOEIN3	Adj. OE [-2] inbound	(opexpse-@if(flgdoooa=1,(ooa3*sale-ooaav)*int3,0))[-2]
AOEIN4	Adj. OE [-3] inbound	(opexpse-@if(flgdoooa=1,(ooa4*sale-ooaav)*int4,0))[-3]
AOEIN5	Adj. OE [-4] inbound	(opexpse-@if(flgdoooa=1,(ooa5*sale-ooaav)*int5,0))[-4]
AOEMAQ1	Adj. OE [0] maquiladora	(opexpse-@if(flgdoooa=1,(ooa1*(cogs-lifrdif+opexpse)-ooaav)*int1,0))[0]
AOEMAQ2	Adj. OE [-1] maquiladora	(opexpse-@if(flgdoooa=1,(ooa2*(cogs-lifrdif+opexpse)-ooaav)*int2,0))[-1]
AOEMAQ3	Adj. OE [-2] maquiladora	(opexpse-@if(flgdoooa=1,(ooa3*(cogs-lifrdif+opexpse)-ooaav)*int3,0))[-2]
AOEMAQ4	Adj. OE [-3] maquiladora	(opexpse-@if(flgdoooa=1,(ooa4*(cogs-lifrdif+opexpse)-ooaav)*int4,0))[-3]
AOEMAQ5	Adj. OE [-4] maquiladora	(opexpse-@if(flgdoooa=1,(ooa5*(cogs-lifrdif+opexpse)-ooaav)*int5,0))[-4]
AOEOUT1	Adj. OE [0] outbound	(opexpse-@if(flgdoooa=1,(ooa1*(cogs-lifrdif)-ooaav)*int1,0))[0]
AOEOUT2	Adj. OE [-1] outbound	(opexpse-@if(flgdoooa=1,(ooa2*(cogs-lifrdif)-ooaav)*int2,0))[-1]
AOEOUT3	Adj. OE [-2] outbound	(opexpse-@if(flgdoooa=1,(ooa3*(cogs-lifrdif)-ooaav)*int3,0))[-2]
AOEOUT4	Adj. OE [-3] outbound	(opexpse-@if(flgdoooa=1,(ooa4*(cogs-lifrdif)-ooaav)*int4,0))[-3]
AOEOUT5	Adj. OE [-4] outbound	(opexpse-@if(flgdoooa=1,(ooa5*(cogs-lifrdif)-ooaav)*int5,0))[-4]
AOEYA1	Adj'd Op. Exp. YA [0]	@if(compyradj=0,aoe1,aoe1[-1])
AOEYA2	Adj'd Op. Exp. YA [-1]	@if(compyradj=0,aoe2,aoe2[-1])
AOEYA3	Adj'd Op. Exp. YA [-2]	@if(compyradj=0,aoe3,aoe3[-1])
AOEYA4	Adj'd Op. Exp. YA [-3]	@if(compyradj=0,aoe4,aoe4[-1])
AOEYA5	Adj'd Op. Exp. YA [-4]	@if(compyradj=0,aoe5,aoe5[-1])
AOMIN1	Adj. OM [0] inbound	(asalein1-acogsin1-aoein1)/asalein1
AOMIN2	Adj. OM [-1] inbound	(asalein2-acogsin2-aoein2)/asalein2
AOMIN3	Adj. OM [-2] inbound	(asalein3-acogsin3-aoein3)/asalein3
AOMIN4	Adj. OM [-3] inbound	(asalein4-acogsin4-aoein4)/asalein4
AOMIN5	Adj. OM [-4] inbound	(asalein5-acogsin5-aoein5)/asalein5
APAV	"average" accounts payable	@if(flgfdgdat=0,(ap+ap[-1])/2,@value((ap+ap[-1])/2,@value(ap,ap[-1])))
APAVYA	Year-aligned apav	@if(compyradj=0,apav,apav[-1])
ASALE1	Adj'd Cogs [0]	@if(flgadjtype=1,asalein1,@if(flgadjtype=2,asalemaq1,asaleout1))
ASALE2	Adj'd Cogs [-1]	@if(flgadjtype=1,asalein2,@if(flgadjtype=2,asalemaq2,asaleout2))
ASALE3	Adj'd Cogs [-2]	@if(flgadjtype=1,asalein3,@if(flgadjtype=2,asalemaq3,asaleout3))
ASALE4	Adj'd Cogs [-3]	@if(flgadjtype=1,asalein4,@if(flgadjtype=2,asalemaq4,asaleout4))
ASALE5	Adj'd Cogs [-4]	@if(flgadjtype=1,asalein5,@if(flgadjtype=2,asalemaq5,asaleout5))
ASALEIN1	Adj. sale [0] inbound	(sale+(ar1*sale-rectrav)*int1/(1+int1*rectrav/sale))[0]
ASALEIN2	Adj. sale [-1] inbound	(sale+(ar2*sale-rectrav)*int2/(1+int2*rectrav/sale))[-1]
ASALEIN3	Adj. sale [-2] inbound	(sale+(ar3*sale-rectrav)*int3/(1+int3*rectrav/sale))[-2]
ASALEIN4	Adj. sale [-3] inbound	(sale+(ar4*sale-rectrav)*int4/(1+int4*rectrav/sale))[-3]
ASALEIN5	Adj. sale [-4] inbound	(sale+(ar5*sale-rectrav)*int5/(1+int5*rectrav/sale))[-4]
ASALEMAQ1	Adj. sale [0] maquiladora	(sale+(ar1*(cogs-lifrdif+opexpse)-rectrav)*int1/(1+int1*rectrav/sale))[0]
ASALEMAQ2	Adj. sale [-1] maquiladora	(sale+(ar2*(cogs-lifrdif+opexpse)-rectrav)*int2/(1+int2*rectrav/sale))[-1]
ASALEMAQ3	Adj. sale [-2] maqiladora	(sale+(ar3*(cogs-lifrdif+opexpse)-rectrav)*int3/(1+int3*rectrav/sale))[-2]
ASALEMAQ4	Adj. sale [-3] maquiladora	(sale+(ar4*(cogs-lifrdif+opexpse)-rectrav)*int4/(1+int4*rectrav/sale))[-3]
ASALEMAQ5	Adj. sale [-4] maquiladora	(sale+(ar5*(cogs-lifrdif+opexpse)-rectrav)*int5/(1+int5*rectrav/sale))[-4]
ASALEOUT1	Adj. sale [0] outbound	(sale+(ar1*(cogs-lifrdif)-rectrav)*int1/(1+int1*rectrav/sale))[0]
ASALEOUT2	Adj. sale [-1] outbound	(sale+(ar2*(cogs-lifrdif)-rectrav)*int2/(1+int2*rectrav/sale))[-1]
ASALEOUT3	Adj. sale [-2] outbound	(sale+(ar3*(cogs-lifrdif)-rectrav)*int3/(1+int3*rectrav/sale))[-2]
ASALEOUT4	Adj. sale [-3] outbound	(sale+(ar4*(cogs-lifrdif)-rectrav)*int4/(1+int4*rectrav/sale))[-3]
ASALEOUT5	Adj. sale [-4] outbound	(sale+(ar5*(cogs-lifrdif)-rectrav)*int5/(1+int5*rectrav/sale))[-4]
ASALEYA1	Adj'd Sale YA [0]	@if(compyradj=0,asale1,asale1[-1])
ASALEYA2	Adj'd Sale YA [-1]	@if(compyradj=0,asale2,asale2[-1])
ASALEYA3	Adj'd Sale YA [-2]	@if(compyradj=0,asale3,asale3[-1])
ASALEYA4	Adj'd Sale YA [-3]	@if(compyradj=0,asale4,asale4[-1])
ASALEYA5	Adj'd Sale YA [-4]	@if(compyradj=0,asale5,asale5[-1])
AWEIGHT1	adjusted weighting [0]	@if(flgadjtype=1,asalein1,@if(flgadjtype=2,acogsmaq1+aoemaq1,acogsout1+aoeout1))
AWEIGHT2	adjusted weighting [-1]	@if(flgadjtype=1,asalein2,@if(flgadjtype=2,acogsmaq2+aoemaq2,acogsout2+aoeout2))
AWEIGHT3	adjusted weighting [-2]	@if(flgadjtype=1,asalein3,@if(flgadjtype=2,acogsmaq3+aoemaq3,acogsout3+aoeout3))
AWEIGHT4	adjusted weighting [-3]	@if(flgadjtype=1,asalein4,@if(flgadjtype=2,acogsmaq4+aoemaq4,acogsout4+aoeout4))
AWEIGHT5	adjusted weighting [-4]	@if(flgadjtype=1,asalein5,@if(flgadjtype=2,acogsmaq5+aoemaq5,acogsout5+aoeout5))
AWEIGHTYA1	Year-aligned aweight1	@if(compyradj=0,aweight1,aweight1[-1])
AWEIGHTYA2	Year-aligned aweight2	@if(compyradj=0,aweight2,aweight2[-1])
AWEIGHTYA3	Year-aligned aweight3	@if(compyradj=0,aweight3,aweight3[-1])
AWEIGHTYA4	Year-aligned aweight4	@if(compyradj=0,aweight4,aweight4[-1])
AWEIGHTYA5	Year-aligned aweight5	@if(compyradj=0,aweight5,aweight5[-1])
COMPYRADJ	Align year to tested party	@if((fyrval+6)-12*@int((fyrval+6)/12)>tpfyend,-1,0)
COMPYRAL	Aligned year to tested party	@if((fyrval+6)-12*@int((fyrval+6)/12)>tpfyend,@yr(-1y),@yr(0y))
DENOM	Denominator	@if(flgadjtype=1,sale,@if(flgadjtype=2,cogs-lifrdif+opexpse,cogs-lifrdif))
FYRVAL	Find value for fyr	@value(fyr,@value(fyr[-1],@value(fyr[-2],@value(fyr[-3],@value(fyr[-4],fyr[-5])))))
HLDGPDPAY	Holding period, payables	apav/(cogs-lifrdif)
HLDGPDPAYYA	Holding period, receivables	@if(compyradj=0,hldgpdpay,hldgpdpay[-1])
HLDGPDREC	Holding period, receivables	rectrav/sale
HLDGPDRECYA	Holding period, receivables	@if(compyradj=0,hldgpdrec,hldgpdrec[-1])
INTNORPAY1	i/(1+i*h) for payables	(int1/(1+int1*hldgpdpayya))
INTNORPAY2	i/(1+i*h) for payables [-1]	(int2/(1+int2*hldgpdpayya))[-1]
INTNORPAY3	i/(1+i*h) for payables [-2]	(int3/(1+int3*hldgpdpayya))[-2]
INTNORPAY4	i/(1+i*h) for payables [-3]	(int4/(1+int4*hldgpdpayya))[-3]
INTNORPAY5	i/(1+i*h) for payables [-4]	(int5/(1+int5*hldgpdpayya))[-4]
INTNORREC1	i/(1+i*h) for receivables	(int1/(1+int1*hldgpdrecya))
INTNORREC2	i/(1+i*h) for receivables [-	(int2/(1+int2*hldgpdrecya))[-1]
INTNORREC3	i/(1+i*h) for receivables [-	(int3/(1+int3*hldgpdrecya))[-2]
INTNORREC4	i/(1+i*h) for receivables [-	(int4/(1+int4*hldgpdrecya))[-3]
INTNORREC5	i/(1+i*h) for receivables [-	(int5/(1+int5*hldgpdrecya))[-4]
INVTAV	"average" inventory	@if(flgfdgdat=0,(invt+invt[-1])/2,@value((invt+invt[-1])/2,@value(invt,invt[-1])))
INVTAVYA	Year-aligned invtav	@if(compyradj=0,invtav,invtav[-1])
INVTLIFRAVYA	Year-aligned invtav plus lif	invtavya+lifravya
IQRBOT	Bottom of IQ Range	@cavg(selavg,@set(cpset,@or(@rank(selavg,cpset)=(@int(@ccount(selavg,cpset)*3/4)+1),@rank(selavg,cpset)=(@int((@ccount(selavg,cpset)*3-1)/4)+1))))
IQRBOTNEW	IQR Bottom after Tukey Fltr	@cavg(selavg,@set(@set(cpset,@inrange(selavg,tukbot,tuktop)),@or(@rank(selavg,@set(cpset,@inrange(selavg,tukbot,tuktop)))=(@int(@ccount(selavg,@set(cpset,@inrange(selavg,tukbot,tuktop)))*3/4)+1),@rank(selavg,@set(cpset,@inrange(selavg,tukbot,tuktop)))=(@int((@ccount(selavg,@set(cpset,@inrange(selavg,tukbot,tuktop)))*3-1)/4)+1))))
IQRMED	Median of IQ Range	@cmed(selavg,@set(cpset,@isvalue(selavg)=1))
IQRMEDNEW	IQR Median after Tukey Fltr	@cmed(selavg,@set(cpset,@inrange(selavg,tukbot,tuktop)))
IQRTOP	Top of IQ Range	@cavg(selavg,@set(cpset,@or(@rank(selavg,cpset)=(@int(@ccount(selavg,cpset)/4)+1),@rank(selavg,cpset)=(@int((@ccount(selavg,cpset)-1)/4)+1))))
IQRTOPNEW	IQR Top after Tukey filter	@cavg(selavg,@set(@set(cpset,@inrange(selavg,tukbot,tuktop)),@or(@rank(selavg,@set(cpset,@inrange(selavg,tukbot,tuktop)))=(@int(@ccount(selavg,@set(cpset,@inrange(selavg,tukbot,tuktop)))/4)+1),@rank(selavg,@set(cpset,@inrange(selavg,tukbot,tuktop)))=(@int((@ccount(selavg,@set(cpset,@inrange(selavg,tukbot,tuktop)))-1)/4)+1))))
LIFRAV	"average"  lifr	@if(flgfdglif=0,(lifr+lifr[-1])/2,@value((lifr+lifr[-1])/2,@value(lifr,@value(lifr[-1],0))))
LIFRAVYA	Year-aligned lifrav	@if(compyradj=0,lifrav,lifrav[-1])
LIFRDIF	lifr "difference"	@if(flgfdglif=0,lifr-lifr[-1],@value(lifr-lifr[-1],0))
LIFRMOD	modified lifr	@if(@or(@element(invval,1)=2,@element(invval,2)=2,@element(invval,3)=2,@element(invval,4)=2,@not(@isvalue(@element(invval,1)))),lifr,0)
OOA	Other Operating Assets	ppent
OOAAV	"average" ooa	@if(flgfdgdat=0,(ooa+ooa[-1])/2,@value((ooa+ooa[-1])/2,@value(ooa,ooa[-1])))
OOAAVYA	Year-aligned ooaav	@if(compyradj=0,ooaav,ooaav[-1])
OPEXPSE	Operating Expense	@value(XSGA+DP,sale-cogs-oiadp)
PLI1	Unadjusted PLI [0]	@if(flgadjtype=1,uomin1,@if(flgadjtype=2,umrkmaq1,umrkout1))
PLI2	Unadjusted PLI [-1]	@if(flgadjtype=1,uomin2,@if(flgadjtype=2,umrkmaq2,umrkout2))
PLI3	Unadjusted PLI [-2]	@if(flgadjtype=1,uomin3,@if(flgadjtype=2,umrkmaq3,umrkout3))
PLI4	Unadjusted PLI [-3]	@if(flgadjtype=1,uomin4,@if(flgadjtype=2,umrkmaq4,umrkout4))
PLI5	Unadjusted PLI [-4]	@if(flgadjtype=1,uomin5,@if(flgadjtype=2,umrkmaq5,umrkout5))
PLIAVG	1-5 Yr. Wtd. Ave. Unadj. PLI	@if(yrsavailu>=yrsreq,(@value(pliya1*uweightya1,0)+@if(yrsavg>1,@value(pliya2*uweightya2,0),0)+@if(yrsavg>2,@value(pliya3*uweightya3,0),0)+@if(yrsavg>3,@value(pliya4*uweightya4,0),0)+@if(yrsavg>4,@value(pliya5*uweightya5,0),0))/(@value(uweightya1+pliya1-pliya1,0)+@if(yrsavg>1,@value(uweightya2+pliya2-pliya2,0),0)+@if(yrsavg>2,@value(uweightya3+pliya3-pliya3,0),0)+@if(yrsavg>3,@value(uweightya4+pliya4-pliya4,0),0)+@if(yrsavg>4,@value(uweightya5+pliya5-pliya5,0),0)),sale[30]+sale[-10])
PLIYA1	Year-aligned PLI1	@if(compyradj=0,pli1,pli1[-1])
PLIYA2	Year-aligned PLI2	@if(compyradj=0,pli2,pli2[-1])
PLIYA3	Year-aligned PLI3	@if(compyradj=0,pli3,pli3[-1])
PLIYA4	Year-aligned PLI4	@if(compyradj=0,pli4,pli4[-1])
PLIYA5	Year-aligned PLI5	@if(compyradj=0,pli5,pli5[-1])
RECTRAV	"average" trade receivables	@if(flgfdgdat=0,(rectr+rectr[-1])/2,@value((rectr+rectr[-1])/2,@value(rectr,rectr[-1])))
RECTRAVYA	Year-aligned rectrav	@if(compyradj=0,rectrav,rectrav[-1])
SELAVG	Selected avg. (unadj or adj)	@if(flgrank=0,pliavg,adjpliavg)
TPVERSION	Version of TPTOOL, TPCONC	0.3
TUKBOT	Bottom of Tukey Range	iqrbot-1.5*(iqrtop-iqrbot)
TUKTOP	Top of Tukey Range	iqrtop+1.5*(iqrtop-iqrbot)
UCOGS1YA	Cogs YA [0]	@if(compyradj=0,cogs-lifrdif,(cogs-lifrdif)[-1])
UCOGS2YA	Cogs YA [-1]	@if(compyradj=0,cogs-lifrdif,(cogs-lifrdif)[-1])[-1]
UCOGS3YA	Cogs YA [-2]	@if(compyradj=0,cogs-lifrdif,(cogs-lifrdif)[-1])[-2]
UCOGS4YA	Cogs YA [-3]	@if(compyradj=0,cogs-lifrdif,(cogs-lifrdif)[-1])[-3]
UCOGS5YA	Cogs YA [-4]	@if(compyradj=0,cogs-lifrdif,(cogs-lifrdif)[-1])[-4]
UMRKMAQ1	Unadj. Markup [0] maquil.	(sale-cogs+lifrdif-opexpse)/(cogs-lifrdif+opexpse)
UMRKMAQ2	Unadj. amarkup [-1] maquil.	((sale-cogs+lifrdif-opexpse)/(cogs-lifrdif+opexpse))[-1]
UMRKMAQ3	Unadj. Markup [-2] maquil.	((sale-cogs+lifrdif-opexpse)/(cogs-lifrdif+opexpse))[-2]
UMRKMAQ4	Unadj. Markup [-3] maquil.	((sale-cogs+lifrdif-opexpse)/(cogs-lifrdif+opexpse))[-3]
UMRKMAQ5	Unadj. Markup [-4] maquil.	((sale-cogs+lifrdif-opexpse)/(cogs-lifrdif+opexpse))[-4]
UMRKOUT1	Unadj. Markup [0] outbound	((sale-cogs+lifrdif-opexpse)/(cogs-lifrdif+opexpse))[0]
UMRKOUT2	Unadj. Markup [-1] outbound	((sale-cogs+lifrdif-opexpse)/(cogs-lifrdif+opexpse))[-1]
UMRKOUT3	Unadj. Markup [-2] outbound	((sale-cogs+lifrdif-opexpse)/(cogs-lifrdif+opexpse))[-2]
UMRKOUT4	Unadj. Markup [-3] outbound	((sale-cogs+lifrdif-opexpse)/(cogs-lifrdif+opexpse))[-3]
UMRKOUT5	Unadj. Markup [-4] outbound	((sale-cogs+lifrdif-opexpse)/(cogs-lifrdif+opexpse))[-4]
UOE1YA	Op. Exp. YA [0]	@if(compyradj=0,opexpse,opexpse[-1])
UOE2YA	Op. Exp. YA [-1]	@if(compyradj=0,opexpse,opexpse[-1])[-1]
UOE3YA	Op. Exp. YA [-2]	@if(compyradj=0,opexpse,opexpse[-1])[-2]
UOE4YA	Op. Exp. YA [-3]	@if(compyradj=0,opexpse,opexpse[-1])[-3]
UOE5YA	Op. Exp. YA [-4]	@if(compyradj=0,opexpse,opexpse[-1])[-4]
UOMIN1	Unadj. OM Inbd, [0]	(sale-cogs+lifrdif-opexpse)/sale
UOMIN2	Unadj. OM Inbd, [-1]	((sale-cogs+lifrdif-opexpse)/sale)[-1]
UOMIN3	Unadj. OM Inbd, [-3]	((sale-cogs+lifrdif-opexpse)/sale)[-2]
UOMIN4	Unadj. OM Inbd, [-3]	((sale-cogs+lifrdif-opexpse)/sale)[-3]
UOMIN5	Unadj. OM Inbd, [-4]	((sale-cogs+lifrdif-opexpse)/sale)[-4]
UOMMAQ1	Unadj. OM maq. [0]	(sale-cogs-opexpse)/(cogs+opexpse)
UOMMAQ2	Unadj. OM maq. [-1]	((sale-cogs-opexpse)/(cogs+opexpse))[-1]
UOMMAQ3	Unadj. OM maq. [-2]	((sale-cogs-opexpse)/(cogs+opexpse))[-2]
UOMMAQ4	Unadj. OM maq. [-3]	((sale-cogs-opexpse)/(cogs+opexpse))[-3]
UOMMAQ5	Unadj. OM maq. [-4]	((sale-cogs-opexpse)/(cogs+opexpse))[-4]
USALE1YA	Sale YA [0]	@if(compyradj=0,sale,sale[-1])
USALE2YA	Sale YA [-1]	@if(compyradj=0,sale,sale[-1])[-1]
USALE3YA	Sale YA [-2]	@if(compyradj=0,sale,sale[-1])[-2]
USALE4YA	Sale YA [-3]	@if(compyradj=0,sale,sale[-1])[-3]
USALE5YA	Sale YA [-4]	@if(compyradj=0,sale,sale[-1])[-4]
UWEIGHT1	unadjusted weighting [0]	@if(flgadjtype=1,sale,@if(flgadjtype=2,cogs-lifrdif+opexpse,cogs-lifrdif+opexpse))
UWEIGHT2	unadjusted weighting [-1]	@if(flgadjtype=1,sale,@if(flgadjtype=2,cogs-lifrdif+opexpse,cogs-lifrdif+opexpse))[-1]
UWEIGHT3	unadjusted weighting [-2]	@if(flgadjtype=1,sale,@if(flgadjtype=2,cogs-lifrdif+opexpse,cogs-lifrdif+opexpse))[-2]
UWEIGHT4	unadjusted weighting [-3]	@if(flgadjtype=1,sale,@if(flgadjtype=2,cogs-lifrdif+opexpse,cogs-lifrdif+opexpse))[-3]
UWEIGHT5	unadjusted weighting [-4]	@if(flgadjtype=1,sale,@if(flgadjtype=2,cogs-lifrdif+opexpse,cogs-lifrdif+opexpse))[-4]
UWEIGHTYA1	Yr-aligned uweight1	@if(compyradj=0,uweight1,uweight1[-1])
UWEIGHTYA2	Yr-aligned uweight2	@if(compyradj=0,uweight2,uweight2[-1])
UWEIGHTYA3	Yr-aligned uweight3	@if(compyradj=0,uweight3,uweight3[-1])
UWEIGHTYA4	Yr-aligned uweight4	@if(compyradj=0,uweight4,uweight4[-1])
UWEIGHTYA5	Yr-aligned uweight5	@if(compyradj=0,uweight5,uweight5[-1])
YRSAVAILA	Yrs of data avail., adj pli	@isvalue(adjpliya1)+@if(yrsavg>1,@isvalue(adjpliya2),0)+@if(yrsavg>2,@isvalue(adjpliya3),0)+@if(yrsavg>3,@isvalue(adjpliya4),0)+@if(yrsavg>4,@isvalue(adjpliya5),0)
YRSAVAILU	Yrs of data avail., unad pli	@isvalue(pliya1)+@if(yrsavg>1,@isvalue(pliya2),0)+@if(yrsavg>2,@isvalue(pliya3),0)+@if(yrsavg>3,@isvalue(pliya4),0)+@if(yrsavg>4,@isvalue(pliya5),0)