whileprintingrecords;
numbervar cumul;
if gridrowcolumnvalue("table.structure")="Cumulative Total Discounted Project Cost Cash Flows" then
(
if cumul <0 then
"("+ totext(cumul*-1,0,"")+")" else
totext(cumul,0,"")
) else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,"")+")" else
totext(currentfieldvalue,0,"")
)
whileprintingrecords;
numbervar cumul;
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")in
["Cumulative Total Discounted Project Cost Cash Flows",
"Cumulative Total Discounted After Tax Return on Project","Cumulative Net Discounted After Tax Cash Flows"] then
(
if cumul <0 then
"("+ totext(cumul*-1,0,"")+")" else
totext(cumul,0,"")
) else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,"")+")" else
totext(currentfieldvalue,0,"")
)
Sorry, no that won't work because of the order of processing. You need to have a different variable name for each row you want to accumulate. You can do this in the same formula like this:
//{@accum} in suppression x+2 area:
whileprintingrecords;
numbervar x;
numbervar y;
numbervar z;
if gridrowcolumnvalue("table.structure") = "ABC" then
x := x + currentfieldvalue;
if gridrowcolumnvalue("table.structure") = "DEF" then
y := y + currentfieldvalue;
if gridrowcolumnvalue("table.structure") = "GHI" then
z := z + currentfieldvalue;
//{@display} in display string area:
whileprintingrecords;
numbervar x;
numbervar y;
numbervar z;
if gridrowcolumnvalue("table.structure")="ABC" then
(
if x <0 then
"("+ totext(x*-1,0,"")+")" else
totext(x,0,"")
) else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,"")+")" else
totext(currentfieldvalue,0,"")
) else
if gridrowcolumnvalue("table.structure")="DEF" then
(
if y <0 then
"("+ totext(y*-1,0,"")+")" else
totext(y,0,"")
) else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,"")+")" else
totext(currentfieldvalue,0,"")
) else
if gridrowcolumnvalue("table.structure")="GHI" then
(
if z <0 then
"("+ totext(z*-1,0,"")+")" else
totext(z,0,"")
) else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,"")+")" else
totext(currentfieldvalue,0,"")
)
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")= "Cumulative Total Discounted Project Cost Cash Flows"
then
(
if cumul <0 then
"("+ totext(cumul*-1,0,",")+")" else
totext(cumul,0,",")
)
else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,",")+")" else
totext(currentfieldvalue,0,",")
);
//else
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")= "Cumulative Total Discounted After Tax Return on Project"
then
(
if cumultot <0 then
"("+ totext(cumultot*-1,0,",")+")" else
totext(cumultot,0,",")
)
else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,",")+")" else
totext(currentfieldvalue,0,",")
) ;
//else
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")= "Cumulative Net Discounted After Tax Cash Flows"
then
(
if cumulnet <0 then
"("+ totext(cumulnet*-1,0,",")+")" else
totext(cumulnet,0,",")
) else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,",")+")" else
totext(currentfieldvalue,0,",")
)
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")= "Cumulative Total Discounted Project Cost Cash Flows"
then
(
(
if cumul <0 then
"("+ totext(cumul*-1,0,",")+")" else
totext(cumul,0,",")
)
else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,",")+")" else
totext(currentfieldvalue,0,",")
)
) else
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")= "Cumulative Total Discounted After Tax Return on Project"
then
(
(
if cumultot <0 then
"("+ totext(cumultot*-1,0,",")+")" else
totext(cumultot,0,",")
)
else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,",")+")" else
totext(currentfieldvalue,0,",")
)
) else
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")= "Cumulative Net Discounted After Tax Cash Flows"
then
(
(
if cumulnet <0 then
"("+ totext(cumulnet*-1,0,",")+")" else
totext(cumulnet,0,",")
) else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,",")+")" else
totext(currentfieldvalue,0,",")
)
)
PS. Your reset formula should reset all three variables, too.
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")= "Cumulative Total Discounted Project Cost Cash Flows"
then
(
(
if cumul <0 then
"("+ totext(cumul*-1,0,",")+")" else
totext(cumul,0,",")
)
"==else"""" [")"is missing]
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,",")+")" else
totext(currentfieldvalue,0,",")
)
) else
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")= "Cumulative Total Discounted After Tax Return on Project"
then
(
(
if cumultot <0 then
"("+ totext(cumultot*-1,0,",")+")" else
totext(cumultot,0,",")
)
else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,",")+")" else
totext(currentfieldvalue,0,",")
)
) else
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")= "Cumulative Net Discounted After Tax Cash Flows"
then
(
(
if cumulnet <0 then
"("+ totext(cumulnet*-1,0,",")+")" else
totext(cumulnet,0,",")
) else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,",")+")" else
totext(currentfieldvalue,0,",")
)
)
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")= "Cumulative Total Discounted Project Cost Cash Flows"
then
(
if cumul <0 then
"("+ totext(cumul*-1,0,",")+")" else
totext(cumul,0,",")
) else
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")= "Cumulative Total Discounted After Tax Return on Project"
then
(
if cumultot <0 then
"("+ totext(cumultot*-1,0,",")+")" else
totext(cumultot,0,",")
) else
if gridrowcolumnvalue("ZGCB_M01_ZBOBJ_ZGCB_M01_QFIN_ANLSIS1_V7.[4LVE0F039ABA0HJHVHOLF3BQD]")= "Cumulative Net Discounted After Tax Cash Flows"
then
(
if cumulnet <0 then
"("+ totext(cumulnet*-1,0,",")+")" else
totext(cumulnet,0,",")
) else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,",")+")" else
totext(currentfieldvalue,0,",")
)
Build in lines like this into each set:
(
if cumulnet <0 then
"("+ totext(cumulnet*-1,0,",")+")" else
if cumulnet = 0 then "-" else
totext(cumulnet,0,",")
) else
(
if currentfieldvalue<0 then
"("+totext(currentfieldvalue*-1,0,",")+")" else
if currentfieldvalue = 0 then "-" else
totext(currentfieldvalue,0,",")
)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.