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.
Hello all - I have hit just about every post out there trying to accomplish by goal, but just can't seem to get it to work. I am summing two fields (on a COMPUTE) ACROSS a field. I only want a row total for one of the fields but column totals for both. I'm also having trouble recomputing my compute. Here is what I have: DEFINE FILE MYTABLE COUNTER/I8=1; END TABLE FILE MYTABLE SUM COUNTER COMPUTE CHG_PCT/D12.2% = ( ( COUNTER - LAST COUNTER ) / LAST COUNTER ) * 100; BY 'HI_LEV' NOPRINT BY 'REGION' AS 'Region' ACROSS 'OPENWEEK' ON HI_LEV RECOMPUTE MULTILINES AS 'Total For ' ON TABLE SUMMARIZE COUNTER CHG_PCT AS 'TOTAL' END
Thanks all.This message has been edited. Last edited by: Kerry,
WF (App Studio) 8.2.01m / Windows Mainframe FOCUS 8
Take a look at the multiverb functionality. That will give you the ability to compute the row total for one specific field.
something like
DEFINE FILE MYTABLE
COUNTER/I8=1;
COUNTER2/I5=1;
END
TABLE FILE MYTABLE
SUM
COUNTER2
BY HI_LEV NOPRINT
BY REGION NOPRINT
SUM
COUNTER
COMPUTE CHG_PCT/D12.2% = ( ( COUNTER - LAST COUNTER ) / LAST COUNTER ) * 100;
BY 'HI_LEV' NOPRINT
BY 'REGION' AS 'Region'
ACROSS OPENWEEK
ON HI_LEV RECOMPUTE MULTILINES AS 'Total For '
ON TABLE SUMMARIZE COUNTER CHG_PCT AS 'TOTAL'
END
Now your "rowtotal" will be seen in the first column, but you can use it in a computed field after the across.
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, 2006
Frank, thanks for the quick response. I see how this works, but when I use it my column totals get goofed up. Totals show for only the COUNTER2 and the first column in the across for COUNTER. Still can't get my recompute to work for PCT_CHG.
WF (App Studio) 8.2.01m / Windows Mainframe FOCUS 8
I only want a row total on the COUNTER field I am defining. Not the CHG_PCT that I am computing. However, I would still like column totals for both and have CHG_PCT recompute since is a % calculation.
Like this: week1 week2 week3 WEEK4 TOTAL Region COUNTER CHG_PCT COUNTER CHG_PCT COUNTER CHG_PCT COUNTER CHG_PCT COUNTER AAA 8 . 4 -50% 2 -50% 4 100% 18 BBB 1 . 1 0% 2 100% 6 200% 10 REGION TOT 9 . 5 -44% 4 -20% 10 150% 28
Thanks.
WF (App Studio) 8.2.01m / Windows Mainframe FOCUS 8
Your (or mine) COUNTER2 is the same value as COUNTER so if you use the report as I suggested above the value of COUNTER2 should be the row sum of COUNTER.
After your code
...
ON TABLE SUMMARIZE COUNTER CHG_PCT AS 'TOTAL'
RECAP TOTCOUNT=C1; AS 'Total Counter'
END
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, 2006
1) lets you control which variable you want to handle as a row summary calculation: TABLE FILE CAR SUM SALES AS TOTSALES NOPRINT BY CAR SUM SALES COST ACROSS COUNTRY AND COMPUTE MYSALESTOTAL/D8=C1; BY CAR
double verbs and noprint
2) use ON TABLE COLUMN-TOTAL {fieldname(s)} rather than SUMMARIZE, and it won't try to crank something it can't crank, just sums it up. so your % columns add to 100, if that's what they're s'posed to do.
is this what you wanted? -s
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
DEFINE FILE MYTABLE
COUNTR1/I8=1;
COUNTR2/I8=1;
END
TABLE FILE MYTABLE
SUM COUNTR1 NOPRINT
BY 'HI_LEV'
SUM COUNTR2
COMPUTE CHG_PCT/D12.2% = IF HI_LEV NE LAST HI_LEV THEN 0 ELSE
( ( COUNTR2 - LAST COUNTR2 ) / LAST COUNTR2 ) * 100;
BY 'HI_LEV'
ACROSS 'OPENWEEK'
COMPUTE TOTCOL/I8 = C1 ; AS 'Total'
ON TABLE SUBTOTAL AS 'Total'
END
Hope this helps ...
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
susannah, the following worked for me: DEFINE FILE TABLE1 COUNTER/I8=1; COUNT_TOT/I8=1; END TABLE FILE TABLE1 SUM COUNT_TOT NOPRINT AS 'COUNT_TOT' BY HI_LEV' NOPRINT BY REGION' AS 'Region' SUM COUNTER/I8C AS 'Accts Opnd' COMPUTE CHG_PCT/D12% = IF OPENWEEK EQ 'February 2, 2009' THEN 0 ELSE ( ( COUNTER - LAST COUNTER ) / LAST COUNTER ) * 100; AS 'Pct Chg,Prior Week' BY HI_LEV' NOPRINT BY REGION' AS 'Region' ACROSS 'DDA_ACCT_HIGH_ACTV.DDA_ACCT_HIGH_ACTV.OPENWEEK' AND COMPUTE COUNT_TOTAL/I8 = C1; AS 'Total Accts Opnd' ON HI_LEV SUBTOTAL AS 'Totals for ' ON TABLE COLUMN-TOTAL AS 'GRAND TOTAL' COUNTER CHG_PCT
The RECOMPUTE is not working as hoped. It should recompute CHG_PCT by my calculation at the COLUMN-TOTAL: REGION WEEK1 WEEK2 WEEK3 TOTAL COUNTER | CHG_PCT | COUNTER | CHG_PCT | COUNTER | CHG_PCT | COUNTER AAAA 10 | 0 | 5 | -50% | 2 | -60% | 17 BBBB 7 | 0 | 9 | 28% | 11 | 22% | 27 TOTAL 17 | 0 | 14 | -17% | 13 | -7% | 44
I've tried all combinations of RECOMPUTE and just can't get it to work. But the row total issue I was having is solved. Thanks to all who took the time to respond.
BobV
quote:
Originally posted by susannah: 1) lets you control which variable you want to handle as a row summary calculation: TABLE FILE CAR SUM SALES AS TOTSALES NOPRINT BY CAR SUM SALES COST ACROSS COUNTRY AND COMPUTE MYSALESTOTAL/D8=C1; BY CAR
double verbs and noprint
2) use ON TABLE COLUMN-TOTAL {fieldname(s)} rather than SUMMARIZE, and it won't try to crank something it can't crank, just sums it up. so your % columns add to 100, if that's what they're s'posed to do.
is this what you wanted? -s
WF (App Studio) 8.2.01m / Windows Mainframe FOCUS 8