Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     FML - Computed Percentages not correct on RECAP rows

Read-Only Read-Only Topic
Go
Search
Notify
Tools
FML - Computed Percentages not correct on RECAP rows
 Login/Join
 
Expert
posted
I have a very convoluted FRL report where the percentages on the RECAP rows do not get calculated correctly. I've simplified the code which can be run as-is. The code and result is below. The last column for the SUBTOTAL and TOTAL rows are not correct. I'm terrified of those RECAPS with asterisks, if someone could work this for me I would truly appreciate it.

Thanks.

Code:
-* File rartest1.fex

SET PAGE      = NOLEAD
SET STYLEMODE = FIXED
SET PANEL     = 200
-RUN

FILEDEF RARFILE1 DISK rarfile1.txt
-RUN

-WRITE RARFILE1 NAX01A N NAX 23685895.35 24684053.56 24584281.18 21986382.76
-WRITE RARFILE1 NAX01B N NAX 27141462.90 28219119.02 27991396.95 24804236.62
-WRITE RARFILE1 NAX01C N NAX 22814271.58 23223617.55 23347572.29 20584141.55
-WRITE RARFILE1 NAX01D N NAX   159373.15   168432.05   202199.81   169849.26
-WRITE RARFILE1 NAX01E N NAX      989.77     3688.19    12359.59     2872.22
-WRITE RARFILE1 NAX04H N NAX  1553106.40  1604704.88  1597666.69  1460675.89

FILEDEF MASTER DISK rarfile1.mas
-RUN

-WRITE MASTER FILENAME=RARFILE1, SUFFIX=FIX, $
-WRITE MASTER SEGNAME=RARFILE1, $
-WRITE MASTER FIELDNAME=RARCODE    , FORMAT=A06    , ACTUAL=A06, $
-WRITE MASTER FIELDNAME=FILL1      , FORMAT=A01    , ACTUAL=A01, $
-WRITE MASTER FIELDNAME=RARPREF1   , FORMAT=A01    , ACTUAL=A01, $
-WRITE MASTER FIELDNAME=FILL1      , FORMAT=A01    , ACTUAL=A01, $
-WRITE MASTER FIELDNAME=RARPREF3   , FORMAT=A03    , ACTUAL=A03, $
-WRITE MASTER FIELDNAME=REV201011  , FORMAT=P17.2BC, ACTUAL=A12, $
-WRITE MASTER FIELDNAME=REV201012  , FORMAT=P17.2BC, ACTUAL=A12, $
-WRITE MASTER FIELDNAME=REV201101  , FORMAT=P17.2BC, ACTUAL=A12, $
-WRITE MASTER FIELDNAME=REV201102  , FORMAT=P17.2BC, ACTUAL=A12, $
-RUN

TABLE FILE RARFILE1
SUM
REV201011/P14.2C AS '201011'
REV201012/P14.2C AS '201012'
REV201101/P14.2C AS '201101'
REV201102/P14.2C AS '201102'

COMPUTE DIFF2/P14.2C = REV201102 - REV201101;       AS 'B/(W),$'
COMPUTE PERC2/D6.1  = DIFF2 / ABS(REV201101) * 100; AS 'B/(W),%'

FOR RARCODE
"A) NET INTEREST EARNINGS (NAX) - CORE" OVER
"1. PERSONAL DEPOSITS" OVER
NAX01A AS '    a) Primary Chequing Accounts'      LABEL NAX01A      OVER
NAX01B AS '    b) Interest Chequing Accounts'     LABEL NAX01B      OVER
RECAP NAX01HIGH/P14.2C = NAX01A + NAX01B;
AS 'SUBTOTAL: High Spread Deposits'               LABEL NAX01HIGH   OVER
NAX01C AS '    c) Premium Rate Savings and SSA'   LABEL NAX01C      OVER
NAX01D AS '    d) Tax Free Savings Accounts'      LABEL NAX01D      OVER
NAX04H AS '    e) Accounts in Overdraft'          LABEL NAX04H      OVER
NAX01E AS '    f) Other Personal Deposit / Recon. Amt' LABEL NAX01E OVER
BAR OVER
RECAP NAX01PD/P14.2C = (NAX01A + NAX01B) + NAX01C + NAX01D + NAX01E + NAX04H;
AS 'TOTAL: PERSONAL DEPOSITS (1)'                 LABEL NAX01PD     OVER
" "
END
-RUN

Report result:
                                                                                                                                     B/(W)    B/(W)
                                                        201011             201012             201101             201102              $        %
                                                        ------             ------             ------             ------              -----    -----
 A) NET INTEREST EARNINGS (NAX) - CORE
 1. PERSONAL DEPOSITS
     a) Primary Chequing Accounts                23,685,895.35      24,684,053.56      24,584,281.18      21,986,382.76      -2,597,898.42    -10.6
     b) Interest Chequing Accounts               27,141,462.90      28,219,119.02      27,991,396.95      24,804,236.62      -3,187,160.33    -11.4
 SUBTOTAL: High Spread Deposits                  50,827,358.25      52,903,172.58      52,575,678.13      46,790,619.38      -5,785,058.75   -21.95
     c) Premium Rate Savings and SSA             22,814,271.58      23,223,617.55      23,347,572.29      20,584,141.55      -2,763,430.74    -11.8
     d) Tax Free Savings Accounts                   159,373.15         168,432.05         202,199.81         169,849.26         -32,350.55    -16.0
     e) Accounts in Overdraft                     1,553,106.40       1,604,704.88       1,597,666.69       1,460,675.89        -136,990.80     -8.6
     f) Other Personal Deposit / Recon. Amt             989.77           3,688.19          12,359.59           2,872.22          -9,487.37    -76.8
                                             -----------------  -----------------  -----------------  -----------------  -----------------  -------
 TOTAL: PERSONAL DEPOSITS (1)                    75,355,099.15      77,903,615.25      77,735,476.51      69,008,158.30      -8,727,318.21  -135.12
  

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Francis

I do not have the manuals here, but you can distingues the recaps per column.
So your recap row will get to code lines.
One for the simple sum and one for the last percentage calculation.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
This is the kind of stuff I'm scared of:

RECAP R_TOTAL1(3,*,3) = (R_TOTAL1(*-1) - R_TOTAL1(*-2) ) / R_TOTAL1(*-2) * 100; OVER

I can make it work once, but if I return to this line of code a year later, I don't have a clue what it does.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
you are right, but you know you can add some comment lines in the codes.
just ad a -* and then some text to explain what it means.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
Can someone who reads English translate this to English for me, please?

quote:

A calculation can use a specific column as a base, and refer to all other columns by their displacement from that column. The column to the left of the base column has a displacement of -1 relative to the base column. The column to the right has a displacement of +1. For example,

COMP=FIX(*)-FIX(*-1);
can refer to the change in fixed assets from one period to the next. The reference to COMP=FIX(*) is equivalent to COMP=FIX.

When referring to a prior column, the column must already have been retrieved, or its value is zero.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     FML - Computed Percentages not correct on RECAP rows

Copyright © 1996-2020 Information Builders