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     [CLOSED] producing just totals on a defined column

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] producing just totals on a defined column
 Login/Join
 
Gold member
posted
I have created several defines in my fex the openbalance and closing defines, the user wants to see just totals when it breaks on the transaction type(TT) and on the accountno is this possible/ and is so how ?

DEFINE FILE WF_GL_DETAIL_VIEW ADD
Debits/D15.2=IF PERIOD EQ 10 AND FISCAL_YEAR EQ 2009 AND TRANSAMNT GE 0 THEN TRANSAMNT ELSE 0;
Credits/D15.2=IF PERIOD EQ 10 AND FISCAL_YEAR EQ 2009 AND TRANSAMNT LT 0 THEN TRANSAMNT ELSE 0;
OPENBALANCE/D17.2=IF PERIOD LT 10 AND FISCAL_YEAR EQ 2009 AND TRANSAMNT NE -0 THEN TRANSAMNT ELSE 0;
TRANQTY/D15.2=IF PERIOD EQ 10 AND FISCAL_YEAR EQ 2009 AND TRANSQTY NE -0 THEN TRANSQTY ELSE 0;
TRANDT/MDYY=IF PERIOD EQ 10 AND FISCAL_YEAR EQ 2009 THEN WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.TRANSDATE;
REF/A20=IF PERIOD EQ 10 AND FISCAL_YEAR EQ 2009 THEN REFERENCENO;
CLOSING/D17.2=OPENBALANCE + Credits + Debits;
END
TABLE FILE WF_GL_DETAIL_VIEW
SUM
'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.TRANQTY' AS 'Qty'
'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.Debits' AS 'Debit'
'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.Credits' AS 'Credit'
'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.OPENBALANCE' AS 'Opening Bal'
'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.CLOSING' AS 'Closing Bal'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.CENTER' NOPRINT AS 'Ctr'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNO' AS 'Account,Number'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNAME' AS 'Description'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.TRANSTYPE' AS 'TT'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.TRANDT' AS 'Transdate'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.REF' AS 'Reference,Number'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.PERIOD' NOPRINT AS 'Per,'
PRINT
'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.COMMENT_TEXT' AS 'COMMENT'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.CENTER' NOPRINT AS 'Ctr'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNO' AS 'Account,Number'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNAME' AS 'Description'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.TRANSTYPE' AS 'TT'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.TRANDT' AS 'Transdate'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.REF' AS 'Reference,Number'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.PERIOD' NOPRINT AS 'Per,'

ON WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.CENTER SUBTOTAL AS '*Total For Center'

ON WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNO SUBTOTAL AS '*Total For Account'

ON WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.TRANSTYPE SUBTOTAL AS '*Total For TT'
HEADING
"&DATEtMDYY <+0> &TOD"
"P C C S T R U C T U R A L S, I N C."
"Cost Center Ranges : Detail Financial Report"
"By Cost Center, Acct Number, Trans Type and Transaction Date"
"For Period &PERIOD.Period:. Fiscal Year &FISCALYEAR.Fiscal Year:."
" "
WHERE ( WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.PERIOD LE &PERIOD ) AND ( WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.FISCAL_YEAR EQ &FISCALYEAR ) AND ( WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.PLANT GE '&PLANT1.Plant GE: Plant Is 2 Digits.' ) AND ( WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.PLANT LE '&PLANT2.Plant LE: Plant Is 2 Digits.' );
ON TABLE SET PAGE-NUM ON
ON TABLE COLUMN-TOTAL AS '** Grand Total'
ON TABLE PCHOLD FORMAT PDF

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


WebFOCUS 7.7.1
Windows 2000
Output: Excel and PDF
 
Posts: 82 | Registered: October 04, 2007Report This Post
Expert
posted Hide Post
It doesn't matter if the columns are defined fields or not. You can specify which columns you want to show the total for. Here is an example from the car file:
TABLE FILE CAR
PRINT SALES RCOST DCOST
BY COUNTRY 
BY CAR
BY MODEL
ON CAR SUBTOTAL RETAIL_COST
ON TABLE SUBTOTAL RETAIL_COST
END


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Gold member
posted Hide Post
please look at my code I want to print the total for this field called "openbalance" which is a defined field, and only what it to print after the break by "accountno" the user only wants to see this total once( does not want to see the detail amounts).


WebFOCUS 7.7.1
Windows 2000
Output: Excel and PDF
 
Posts: 82 | Registered: October 04, 2007Report This Post
Virtuoso
posted Hide Post
Here's an approach to try:

calculate the opening and closing bal, and the number of detail rows, at the account level (another SUM, with NOPRINT on its dependent columns and fewer BY's). calculate the row number within its account for each detail record. Now you can identify the first and last detail line for each account break.

calculate the displayed opening balance column for the first row of the account as the account-level opening bal, and zero for all the other rows; give it a computed format, defined to print normally when it's the first row, and with 'S' suffix, so it shoots blanks, if it's any other row.

Similarly for the closing balance (to print with either the first or last detail row of the account, as you wish)
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
I trimmed my by's to 3, I created a new define field called count_record, where do I do the define to print normally when it row one and the 'S' suffix if not row one?

DEFINE FILE WF_GL_DETAIL_VIEW ADD
OPENBAL/D17.2=IF PERIOD LT &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR THEN TRANSAMNT ELSE 0;
count_record/I5 = IF TRANSAMNT THEN count_record + 1 ELSE 0;
Debits/D15.2=IF PERIOD = &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR AND TRANSAMNT GE 0 THEN TRANSAMNT ELSE 0;
Credits/D15.2=IF PERIOD = &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR AND TRANSAMNT LT 0 THEN TRANSAMNT ELSE 0;
REF/A12=IF PERIOD EQ &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR THEN REFERENCENO;
COM/A12=IF PERIOD EQ &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR THEN COMMENT_TEXT;
QTY/D12=IF PERIOD EQ &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR THEN TRANSQTY ELSE 0;
TT/A2=IF PERIOD EQ &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR THEN TRANSTYPE;
TD/MDYY=IF PERIOD EQ &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR THEN TRANSDATE;

END
TABLE FILE WF_GL_DETAIL_VIEW
SUM
'OPENBAL' AS 'Opening,Balance'
'COUNT_RECORD' NOPRINT
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.CENTER' NOPRINT AS 'Ctr'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNO' AS 'Account,Number'
BY 'TT'
BY 'TD' AS 'Transdate'
PRINT
'REF' AS 'Reference,Number'
'COM' AS 'Comment'
'QTY' AS 'Qty'
'Debits' AS 'Debit'
'Credits' AS 'Credit'
'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNAME' AS 'Description'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.CENTER' NOPRINT AS 'Ctr'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNO' AS 'Account,Number'
BY 'TT'
BY 'TD' AS 'Transdate'
ON WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.CENTER SUBTOTAL AS '*Total For Center'

ON WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNO SUBTOTAL AS '*Total For Account'

ON TT SUBTOTAL AS '*Total For TT'
HEADING


WebFOCUS 7.7.1
Windows 2000
Output: Excel and PDF
 
Posts: 82 | Registered: October 04, 2007Report This Post
Gold member
posted Hide Post
I am having a problem getting the count(rownum) to work the way I would like it to work, when it hits a new accountno I want it to set the count back to zero.
COMPUTE ROWNUM/I5 = IF ACCOUNTNO EQ LAST ACCOUNTNO THEN ROWNUN +1 ELSE 0;

this is the complete code:

DEFINE FILE WF_GL_DETAIL_VIEW ADD
OPENBAL/D17.2=IF PERIOD LT &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR THEN TRANSAMNT ELSE 0;
Debits/D15.2=IF PERIOD = &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR AND TRANSAMNT GE 0 THEN TRANSAMNT ELSE 0;
Credits/D15.2=IF PERIOD = &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR AND TRANSAMNT LT 0 THEN TRANSAMNT ELSE 0;
REF/A12=IF PERIOD EQ &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR THEN REFERENCENO;
COM/A12=IF PERIOD EQ &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR THEN COMMENT_TEXT;
QTY/D12=IF PERIOD EQ &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR THEN TRANSQTY ELSE 0;
TT/A2=IF PERIOD EQ &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR THEN TRANSTYPE;
TD/MDYY=IF PERIOD EQ &PERIOD AND FISCAL_YEAR EQ &FISCALYEAR THEN TRANSDATE;

END
TABLE FILE WF_GL_DETAIL_VIEW
SUM
COMPUTE ROWNUM/I5 = IF ACCOUNTNO EQ LAST ACCOUNTNO THEN ROWNUN +1 ELSE 0;
'OPENBAL' AS 'Opening,Balance'

BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.CENTER' NOPRINT AS 'Ctr'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNO' AS 'Account,Number'
BY 'TT'
BY 'TD' AS 'Transdate'
PRINT
'REF' AS 'Reference,Number'
'COM' AS 'Comment'
'QTY' AS 'Qty'
'Debits' AS 'Debit'
'Credits' AS 'Credit'
'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNAME' AS 'Description'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.CENTER' NOPRINT AS 'Ctr'
BY 'WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNO' AS 'Account,Number'
BY 'TT'
BY 'TD' AS 'Transdate'
ON WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.CENTER SUBTOTAL AS '*Total For Center'

ON WF_GL_DETAIL_VIEW.WF_GL_DETAIL_VIEW.ACCOUNTNO SUBTOTAL AS '*Total For Account'

ON TT SUBTOTAL AS '*Total For TT'
HEADING
"&DATEtMDYY <+0> &TOD"


WebFOCUS 7.7.1
Windows 2000
Output: Excel and PDF
 
Posts: 82 | Registered: October 04, 2007Report This Post
Virtuoso
posted Hide Post
quote:
COMPUTE ROWNUM/I5 = IF ACCOUNTNO EQ LAST ACCOUNTNO THEN ROWNUN +1 ELSE 0;

I take it that you have already noticed the typo? (rownuN iso rownuM).


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Master
posted Hide Post
Try:
COMPUTE ROWNUM/I5 = IF ACCOUNTNO EQ LAST ACCOUNTNO THEN LAST ROWNUM+1 ELSE 0;


You have ROWNUN in your THEN clause. If you want ROWNUM to start with 0, then this should work. If you want it to start with 1, change the 0 to 1.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Gold member
posted Hide Post
Thanks I have fixed the typo, I still have a problem on the breaks, when it breaks on the accountno I get 0 and that's what I want but with in that account it breaks on TT and that is also 0, I want to print open bal on just the break of accountno when rownum is 0 not every 0.


WebFOCUS 7.7.1
Windows 2000
Output: Excel and PDF
 
Posts: 82 | Registered: October 04, 2007Report This Post
Virtuoso
posted Hide Post
DaveZ,

But the sum of the open balance is calculated for each mentioned sort field. If you would print only the open balance when the account number changes value, then you would lose all openbalances for all underlying levels.
I would try and see if the desired result is achieved when you remove the by tt and by td phrases from the first request set (under the sum that is). Leave them under the print.

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Gold member
posted Hide Post
It is closer, I need to get the rownum at the detail level, or by pass the count "ON TT SUBTOTAL" it shows 0 at that "ON TT SUBTOTAL" level so then it prints the open bal which I don't want it to print there.

Thanks for all the help


WebFOCUS 7.7.1
Windows 2000
Output: Excel and PDF
 
Posts: 82 | Registered: October 04, 2007Report 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     [CLOSED] producing just totals on a defined column

Copyright © 1996-2020 Information Builders