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 have a piece of code here that uses an actual Sql query developed in a Rdbms and then used in the WebFocus code. The problem is I cannot get the subtotal for each card type to show unless I also show the item_count column as well. Is there a way I can show the subtotal for each card without the item_count showing? Thanks. SET NODATA = ' ' SET SQLENGINE=SQLORA SQL SET SERVER DWD_DLHCM SQL SELECT DISTINCT cf.card_type_code ,sr.reason_code ,oi.card_dcn ,oi.oi_identifier ,oi.create_date ,oi.oi_dl ,oi.item_count FROM DWDH_OWNER.DWDHF_ORDER_ITEM oi ,DWDH_OWNER.DWDHF_CARD_STOCK cs ,(SELECT * FROM DWDH_OWNER.DWDHD_STATUS_REASON WHERE CUR_IND_FLG = 'Y') sr ,(SELECT * FROM DWDH_OWNER.DWDHD_CARDFILE_TYPE WHERE CUR_IND_FLG = 'Y') cf ,(SELECT * FROM DWGL_OWNER.DWGLD_COMPANY WHERE CUR_IND_FLG = 'Y') c WHERE cs.card_dcn = oi.card_dcn (+) AND oi.dhd_status_reason_id = sr.id AND oi.dhd_cardfile_type_id = cf.id AND oi.gld_company_id = c.id AND (sr.STATUS_CODE = 'PROD_F') AND (sr.REASON_CODE IN ('CARD_DAMAGED', 'DATA_QUALITY', 'SIGNATURE_QUALITY', 'IMAGE_QUALITY', 'INC_DATA')) AND TO_CHAR( oi.oi_EFFECTIVE_DT, 'YYYY-MM-DD') BETWEEN '2007-05-01' AND '2007-06-30' ; TABLE ON TABLE HOLD AS DR2 END TABLE FILE DR2 SUM CARD_TYPE_CODE REASON_CODE CARD_DCN OI_IDENTIFIER CREATE_DATE OI_DL ITEM_COUNT BY CARD_TYPE_CODE NOPRINT BY CARD_DCN NOPRINT BY CREATE_DATE NOPRINT ON CARD_TYPE_CODE SUBTOTAL AS 'TOTAL ' ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE SET ONLINE-FMT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=IN, PAGESIZE='SCREEN', LEFTMARGIN=0.000000, RIGHTMARGIN=0.000000, TOPMARGIN=0.000000, BOTTOMMARGIN=0.000000, SQUEEZE=ON, ORIENTATION=PORTRAIT, $ TYPE=REPORT, GRID=OFF, FONT='TIMES NEW ROMAN', SIZE=10, COLOR='BLACK', BACKCOLOR='NONE', STYLE=NORMAL, $ ENDSTYLE END
I tried these lines of code: ON CARD_TYPE_CODE SUBTOTAL ITEM_COUNT AS 'TOTAL ' WHERE CARD_TYPE_CODE IN ('DLCARD_V1', 'HCARD_V1'); which gives exactly the same results as the first way I did it: ON CARD_TYPE_CODE SUBTOTAL AS 'TOTAL '
You want to display the total number of ITEM_COUNT without display it in each line. This cannot be done with SUBTOTAL but with SUBFOOT and a multi-set request.
After TABLE FILE DR2 add:
SUM ITEM_COUNT NOPRINT
BY CARD_TYPE_CODE NOPRINT
and then in place of ON CARD_TYPE_CODE SUBTOTAL AS 'TOTAL ' write
ON CARD_TYPE_CODE SUBFOOT
"<ST.ITEM_COUNT "
This should do the trick.
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
As Daniel mentions, you cannot SUTOTAL a field that is not a displayed report column - SUBFOOT is the method we use for that.
Or, alternatively, a multi-verb request *may* be acceptable, the subtotal is not on a line by itself, but as a report column:
TABLE FILE CAR
SUM
WHEELBASE AS 'Total Wheelbase'
BY COUNTRY
SUM
SALES
BY COUNTRY
BY CAR
END
The WHEELBASE column is SUMmed in the first verb and the SALES are SUMmed in the second.
The result would look like the following:
COUNTRY Total Wheelbase CAR SALES
--------- --------------- ------------ -------------
ENGLAND 407.8 JAGUAR 12000
JENSEN 0
TRIUMPH 0
FRANCE 108.0 PEUGEOT 0
ITALY 384.4 ALFA ROMEO 30200
MASERATI 0
JAPAN 185.4 DATSUN 43000
TOYOTA 35030
W GERMANY 721.7 AUDI 7800
BMW 0390
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
Thanks Danny, I got it to work the way you told me. On a hunch, I tried TOT.ITEM_COUNT in the table FOOTING and then I got the grand total to show as well. Thanks very much.
Hello, My old code worked fine when the output was all on one page. When it was on more than one page, it didn't work correctly so I had to make changes. The total card production failures was moved to a ON TABLE SUBFOOT line instead of a FOOTING line in the old code. However, the ON CARD_TYPE_CODE SUBFOOT line now shows ** for the first card type and a correct number for the second card type. The total card type line now shows ** as well. Should I do another pass on the table before I can dipslay those numbers? I did a query on the hold file and has shown it in the code. The output is shown after the code. Thank you.
-SET &ECHO=ALL; SET NODATA = ' ' SET PRINTPLUS = ON -DEFAULT &FROM_DATE = '20070301'; -DEFAULT &TO_DATE = '20070331'; -DEFAULT &ADATE1 = '20070601'; -DEFAULT &ADATE2 = '20070630'; -DEFAULT &OUTPUT = 'HTML'; -* -SET &REP_NAME = 'Detailed Card Production Failures Report'; -SET &RUN_DATE = &DATEMtrDYY; -SET &RUN_TIME = EDIT(HHMMSS('A8'),'99$:99$:99'); -SET &ORIENTATION = 'LANDSCAPE'; -SET &ADATETIME1 = EDIT(&ADATE1,'9999-99-99')| ' 00:00:00'; -SET &ADATETIME2 = EDIT(&ADATE2,'9999-99-99')| ' 23:59:59'; -SET &ADATE1TEXT = LCWORD(17,CHGDAT('YYMD', 'MXDYY', &ADATE1, 'A17'), 'A17'); -SET &ADATE2TEXT = LCWORD(17,CHGDAT('YYMD', 'MXDYY', &ADATE2, 'A17'), 'A17'); -SET &FROM_DATE = EDIT(&ADATE1,'9999-99-99'); -SET &TO_DATE = EDIT(&ADATE2,'9999-99-99'); -* SET SQLENGINE=SQLORA SQL SET SERVER DWD_DLHCM SQL SELECT cf.card_type_code, sr.reason_code, oi.card_dcn, oi.oi_identifier, cs.sts, oi.oi_effective_dt, oi.oi_dl, oi.item_count FROM DWDH_OWNER.DWDHF_ORDER_ITEM oi ,DWDH_OWNER.DWDHD_STATUS_REASON sr ,DWDH_OWNER.DWDHD_CARDFILE_TYPE cf ,DWGL_OWNER.DWGLD_COMPANY c ,(select card_dcn, cssr.status_code sts from dwdhf_card_stock, dwdhd_status_reason cssr where dwdhf_card_stock.dhd_status_reason_id = cssr.id and cssr.status_code = 'DEST') cs WHERE oi.dhd_status_reason_id = sr.id and sr.cur_ind_flg = 'Y' AND oi.dhd_cardfile_type_id = cf.id and cf.cur_ind_flg = 'Y' AND oi.gld_company_id = c.id and c.cur_ind_flg = 'Y' AND sr.STATUS_CODE = 'PROD_F' AND sr.REASON_CODE IN ('CARD_DAMAGED', 'DATA_QUALITY', 'SIGNATURE_QUALITY', 'IMAGE_QUALITY', 'INC_DATA') AND TO_CHAR( oi.oi_effective_dt, 'YYYY-MM-DD') BETWEEN '&FROM_DATE' AND '&TO_DATE' and oi.card_dcn = cs.card_dcn (+) ORDER BY 1,4,6 ; TABLE ON TABLE HOLD AS DR2V4 END -RUN -*? HOLD DR2V4 -*0DEFINITION OF HOLD FILE: DR2V4 -* 0FIELDNAME ALIAS FORMAT -* CARD_TYPE_CODE E01 A30 -* REASON_CODE E02 A30 -* CARD_DCN E03 A100 MISSING = ON -* OI_IDENTIFIER E04 A100 -* STS E05 A30 MISSING = ON -* OI_EFFECTIVE_DT E06 HYYMDS -* OI_DL E07 A17 MISSING = ON -* ITEM_COUNT E08 P2 TABLE FILE DR2V4 SUM ITEM_COUNT/I7 NOPRINT BY CARD_TYPE_CODE NOPRINT PRINT CARD_TYPE_CODE AS 'Card Type' REASON_CODE AS 'Reason Code' CARD_DCN AS 'DCN' OI_IDENTIFIER AS 'Order ID' STS AS 'Card Stock,Status' OI_EFFECTIVE_DT AS 'Timestamp' OI_DL AS 'DL' BY CARD_TYPE_CODE NOPRINT BY OI_IDENTIFIER NOPRINT BY OI_EFFECTIVE_DT NOPRINT ON CARD_TYPE_CODE SUBFOOT "Total HEADING "DL Card and Health Card Contract Management" "Detailed Card Production Failures Report" "From: &ADATE1TEXT.EVAL To: &ADATE2TEXT.EVAL " " " -*FOOTING ON TABLE SUBFOOT "Total Card Production Failures : "Report ID: DR2V4 / Date: &RUN_DATE / Time: &RUN_TIME / <+34> Page ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT '&OUTPUT' ON TABLE SET CSSURL '/approot/mtomis/report.css' ON TABLE SET STYLE * -* -GOTO STY_&OUTPUT.EVAL -* -STY_HTML -STY_EXL2K -MRNOEDIT -INCLUDE STYLE011 -GOTO STY_END -* -STY_PDF -MRNOEDIT -INCLUDE STYLE021 -* -STY_EXCEL -STY_END ENDSTYLE END -RUN -* -IF &LINES GT 0 GOTO REPORT_END; -* -NO_DATA -MRNOEDIT -INCLUDE MISI200 -* -REPORT_END
Output: DL Card and Health Card Contract Management Detailed Card Production Failures Report From: June 01 2007 To: June 30 2007
Thanks, I tried what PBrightwell said yesterday and it worked so my problem is fixed. I will keep your suggestion in mind next time. The field I had to display was a P2 format. Rgds.