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.
I've stacked multiple across-totals in order to get the required sorting/grouping (I used country from the CAR sample to illustrate this).
Two things I'm struggling with: 1) Totaling by 'region' and having the across-total column title display. 2) to complicate things further, I really only want a total when the region is 'EUROPE'.
My 'real-world' report requires that the columns be dynamic so making Defines rather than using across is not an option.
DEFINE FILE CAR
SORT_FIELD/A1= DECODE COUNTRY(ENGLAND 'A' FRANCE 'B' 'W GERMANY' 'C' 'JAPAN' 'D' 'ITALY' 'E');
REGION/A10= DECODE COUNTRY(ENGLAND 'EUROPE' FRANCE 'EUROPE' 'W GERMANY' 'EUROPE' 'JAPAN' 'ASIA' 'ITALY' 'EUROPE');
END
TABLE FILE CAR
SUM
LENGTH
OVER WIDTH
BY MODEL
ACROSS REGION NOPRINT
ACROSS SORT_FIELD NOPRINT ACROSS-TOTAL AS 'TOTAL REGION'
ACROSS COUNTRY
END
This message has been edited. Last edited by: JohnGalt,
Here's one approach. Append the required summary data to a HOLD file already containing the detail data and report from the combined file. Just be careful that your summary fields are the exact same format and length as the detail fields. Otherwise you have garbage in your HOLD file. By placing a blank in front of the country names, the TOTAL column sorts to last place in the ACROSS.
-* Prepare HOLD file for appending data.
FILEDEF HOLD1 DISK HOLD1.FTM (APPEND
-*
DEFINE FILE CAR
COUNTRYX/A11 = ' ' | COUNTRY ;
REGION/A6 = DECODE COUNTRY('JAPAN' 'ASIA' ELSE 'EUROPE');
REG_SORT/I1 = DECODE REGION('ASIA' 1 'EUROPE' 2 ELSE 9);
TOT_CNTRY/A11 = 'TOTAL';
END
-* Extract necessary detail data and place in HOLD file.
TABLE FILE CAR
SUM
LENGTH
WIDTH
BY REGION
BY REG_SORT
BY COUNTRYX
BY MODEL
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-* Save summary data in same HOLD file.
TABLE FILE CAR
SUM
LENGTH
WIDTH
BY REGION
BY REG_SORT
BY TOT_CNTRY
BY MODEL
WHERE REGION EQ 'EUROPE';
ON TABLE SAVE AS HOLD1
END
-* Produce the report.
TABLE FILE HOLD1
SUM LENGTH
OVER WIDTH
BY MODEL
ACROSS REG_SORT NOPRINT
ACROSS REGION AS ''
ACROSS COUNTRYX AS ''
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007