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 am using App Studio and am on WF 8.2.01M. I have several reports being appended to a hold file which will be used to produce a final report. Several of these included reports contain subtotals, but not all. These subtotals don't carry over into the final. How can I accomplish this?This message has been edited. Last edited by: FP Mod Chuck,
WebFOCUS 7.6 Windows, All Outputs
Posts: 26 | Location: Oklahoma City | Registered: January 27, 2012
Subtotal are not included in a hold file since it's a report feature not a "hold data" feature. Or I don't know the SET command that allows that if one exist.
What I suggest is to have all your files hold together and don't mind about the subtotal for those that need one. Hold the pure real data only. Add another field to your data to identify which set of data must have a subtotal (e.g: COMPUTE DISPLAY_ST /A1 = 'Y'; )
Then in you last step when producing the final report test that field to include the subtotal or not.
Something such as (please, I know that my "custom" subtotal may have been accomplished in a much more efficient way, but it's only to show the technic to JackieO)
TABLE FILE CAR
SUM SEATS
COMPUTE DISPLAY_ST /A1 = 'N';
BY COUNTRY
WHERE COUNTRY EQ 'ITALY';
ON TABLE HOLD AS TMP1
END
-RUN
TABLE FILE CAR
SUM SEATS
COMPUTE DISPLAY_ST /A1 = 'Y';
BY COUNTRY
WHERE COUNTRY NE 'ITALY';
ON TABLE HOLD AS TMP2
END
-RUN
TABLE FILE TMP1
SUM SEATS
BY COUNTRY
ON COUNTRY SUBTOTAL
WHEN DISPLAY_ST EQ 'Y';
ON TABLE PCHOLD FORMAT HTML
MORE
FILE TMP2
END
-RUN
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
DEFINE FILE JO_HOLD1 Supressed_Male/I7C MISSING ON=IF MALE EQ 0 THEN MISSING ELSE MALE; Supress_Female/I7C MISSING ON=IF FEMALE EQ 0 THEN MISSING ELSE FEMALE; Supress_Total/I9C MISSING ON=IF TOTAL EQ 0 THEN MISSING ELSE TOTAL; TotalRecordCount/I9C=IF CAT1 EQ 1 THEN TOTAL; END TABLE FILE JO_HOLD1 SUM Supressed_Male AS 'MALE' Supress_Female AS 'FEMALE' Supress_Total AS 'TOTAL' BY YEAR NOPRINT BY LOWEST INSTITUTION_CODE NOPRINT BY LOWEST LONG_NAME NOPRINT BY LOWEST CAT1 NOPRINT BY LOWEST CAT1_DESC AS 'CATEGORY' BY LOWEST GRP1 NOPRINT BY LOWEST GRP1_DESC AS 'SUBGROUP,ONE' BY LOWEST GRP2 NOPRINT BY LOWEST GRP2_DESC AS 'SUBGROUP,TWO' BY LOWEST GRP3 NOPRINT BY GRP3_DESC AS 'SUBGROUP,THREE' HEADING "OKLAHOMA STATE REGENTS FOR HIGHER EDUCATION" "UDS PROFESSIONAL STAFF DATA SUBMISSION SUMMARY FOR: <+0> &ACAD_YEAR_DISPLAY (SEE NOTE*)" "REPORT END DATE: &DATEMDYY" "ON TABLE SET PAGE-NUM OFF ON TABLE SET ASNAMES ON ON TABLE NOTOTAL ON TOTAL SUBTOTAL WHEN SUB_TOTAL EQ 'Y'; ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLEMBEDIMG ON ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = IBFS:/FILE/IBI_HTML_DIR/ibi_themes/ok.sty, $ TYPE=REPORT, LINES-PER-PAGE=UNLIMITED, $ ENDSTYLE END
Am getting "Field is not a sort field: TOTAL". This is true, but do not know what to put here.
WebFOCUS 7.6 Windows, All Outputs
Posts: 26 | Location: Oklahoma City | Registered: January 27, 2012
DEFINE FILE JO_HOLD1 Supressed_Male/I7C MISSING ON=IF MALE EQ 0 THEN MISSING ELSE MALE; Supress_Female/I7C MISSING ON=IF FEMALE EQ 0 THEN MISSING ELSE FEMALE; Supress_Total/I9C MISSING ON=IF TOTAL EQ 0 THEN MISSING ELSE TOTAL; TotalRecordCount/I9C=IF CAT1 EQ 1 THEN TOTAL; END TABLE FILE JO_HOLD1 SUM Supressed_Male AS 'MALE' Supress_Female AS 'FEMALE' Supress_Total AS 'TOTAL '
If Supress_Total is the sum of Male and Female values then create a virtual filed (compute/Define) to add both the values.
DEFINE FILE JO_HOLD1
Supressed_Male/I7C MISSING ON=IF MALE EQ 0 THEN MISSING ELSE MALE;
Supress_Female/I7C MISSING ON=IF FEMALE EQ 0 THEN MISSING ELSE FEMALE;
TotalRecordCount/I9C=IF CAT1 EQ 1 THEN TOTAL;
END
TABLE FILE JO_HOLD1
SUM
Supressed_Male AS 'MALE'
Supress_Female AS 'FEMALE'
COMPUTE SUP_TOT/I11 MISSING ON = (MALE+FEMALE) ;AS 'TOTAL'
Am getting "Field is not a sort field: TOTAL". This is true, but do not know what to put here.
First, personally, I won't have a field named "TOTAL" when this word may refer to a reserved word or make confusion, but this is your code. Second, where does this "TOTAL" field come from ? What is it ? Third, SUBTOTAL/SUB-TOTAL/SUBHEAD/SUBFOOT only apply on a BY field. So you need to have your "TOTAL" field part of the report.
If you refer back to my sample, you will see that I did not create any subtotal by COUNTRY from the hold files but in final report yes.
Another technic is to create hold file for you detailed data and hold file for your subtotal data. Then have all merged together and properly ordered as final step. With that technic no need to include "ON abc SUBTOTAL"
Something such as
TABLE FILE CAR
SUM SEATS
BY COUNTRY
BY TOTAL COMPUTE ROWID /I2 = 0;
BY CAR
ON TABLE HOLD AS DETDATA
END
-RUN
TABLE FILE CAR
SUM SEATS
BY COUNTRY
BY TOTAL COMPUTE ROWID /I2 = 1;
BY TOTAL COMPUTE CAR /A16 = 'Sub Total';
WHERE COUNTRY NE 'ITALY';
ON TABLE HOLD AS STOTDATA
END
-RUN
TABLE FILE DETDATA
SUM SEATS
BY COUNTRY
BY ROWID NOPRINT
BY CAR
ON TABLE PCHOLD FORMAT HTML
MORE
FILE STOTDATA
END
-RUN
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
Again...thank you all for your wonderful advice. Especially MartinY. You are 100% correct in that reserved words should never be used as variables, defines, etc...
I've made corrections and reworked the subtotal per your advice. Works great!
Again...many, many thanks! JO
WebFOCUS 7.6 Windows, All Outputs
Posts: 26 | Location: Oklahoma City | Registered: January 27, 2012