Focal Point
[CLOSED] exl2k formula running total

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2927043995

February 25, 2011, 01:02 PM
pwoods
[CLOSED] exl2k formula running total
I have a report that outputs some running totals within excel. Now the users have asked for the fomulas for those totals to be included so that if they edit any of the data in the report the totals auto-update.

I thought this would be simple enough to achieve using exl2k formula but when i switch the output format i get a circular reference in excel.

Am I missing something or is this just not possible in exl2k formula?

Example Code:
TABLE FILE GGSALES
SUM
UNITS
DOLLARS
COMPUTE RUNTOT/I10 = LAST RUNTOT+UNITS;
BY CITY
ON TABLE COLUMN-TOTAL
ON TABLE PCHOLD FORMAT EXL2K FORMULA
END

This message has been edited. Last edited by: Kerry,


AIX Server
WebFocus 7.6.11
February 25, 2011, 01:41 PM
Tom Flynn
This works. I'm sure there are other ways; this is just one way. A Multi-verb request may work?
This also removes the dreaded EXCEL circular reference:

  
APP PREPENDPATH IBISAMP
-RUN
-SET &ECHO=ALL;
DEFINE FILE GGSALES
  XUNITS/I10C = UNITS;
END
TABLE FILE GGSALES 
SUM 
    XUNITS 
    DOLLARS
      COMPUTE CNT/I5 = CNT + 1;
  BY CITY 
 ON TABLE HOLD AS HOLD1
END
-RUN
DEFINE FILE HOLD1
  RUN_TOTAL/I10C = IF CNT EQ 1 THEN XUNITS ELSE LAST RUN_TOTAL + XUNITS;
END
TABLE FILE HOLD1
SUM 
    XUNITS AS 'UNITS'
    DOLLARS
    RUN_TOTAL
  BY CITY 
ON TABLE COLUMN-TOTAL 
ON TABLE PCHOLD FORMAT EXL2K FORMULA 
END
-EXIT


BUT, as an example, Cell D3 will "not" show =SUM(D2+B3) or =SUM(D2:B3)...

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
February 28, 2011, 11:37 AM
pwoods
Thanks Tom - but this isnt what I am after.

I want the formula for the running total to be displayed, not the result - hence the use of EXL2K FORMULA as the output.

As an example I tried thi code, but it seems the use of LAST means the formula doesnt translate correctly in Excel.

TABLE FILE GGSALES
SUM
UNITS
DOLLARS
RANKED AS 'SEQ' BY CITY
ON TABLE HOLD AS HOLD1
ON TABLE SET ASNAMES ON
END
-RUN



TABLE FILE HOLD1
SUM
UNITS
DOLLARS
COMPUTE RUNTOT/I10 = IF SEQ EQ 1 THEN UNITS ELSE (LAST RUNTOT+ UNITS);
BY CITY
-*ON TABLE COLUMN-TOTAL
ON TABLE PCHOLD FORMAT EXL2K FORMULA
END

This message has been edited. Last edited by: pwoods,


AIX Server
WebFocus 7.6.11
March 04, 2011, 02:00 PM
Kerry
Hi pwoods,

I checked with our technicals and was suggested that this looks like an issue to be fixed by programming, so please open a case with Customer Support Services to submit this. You may either call at 1-800-736-6130, or access online at InfoResponse.

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.