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.
Hi, I've a report which has 10 static columns. It displays all the 10 columns at any given time even if 5 columns (out of these 10 columns) have all zero or null values which is an absolute waste. So I want to make these columns dynamic, i.e. only those columns should be displayed which have at least one non-zero value and those columns should be suppressed which have all zero or null values. Any suggestions are welcome.
Here's a suggestion, since you want something dynamic, it will take two passes through the data, one to determine which columns are blank and one for the report.
-SET &ECHO=ALL;
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
-RUN
DEFINE FILE CAR
DUMMY1/I6 = 0;
END
-RUN
TABLE FILE CAR
SUM
ACCEL/D15
DUMMY1/D15
ON TABLE HOLD AS H001
END
-RUN
-READ H001 &A_ACCEL.I15. &A_DUMMY1.I15.
-SET &REP_LINE = IF &A_ACCEL GT 0 THEN 'ACCEL' ELSE '';
-SET &REP_LINE = IF &A_DUMMY1 GT 0 THEN 'DUMMY1' ELSE &REP_LINE;
TABLE FILE CAR
PRINT
&REP_LINE
HEADING
"WEBFOCUS REPORT"
ON TABLE SET PAGE NOLEAD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLESHEET *
BORDER=1, BORDER-COLOR=SILVER,
FONT='ARIAL', SIZE=8, $
END
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
Please update your signature so we all know what version you are using.
To answer your question, I would first put the data into a hold file, then test if the values are worth to be displayed by summing the absolute value. if the absolute value per field is not zero it should be displayed
-SET &ECHO=ALL;
TABLE FILE CAR
SUM SALES RETAIL_COST COMPUTE ZERO=0;
BY COUNTRY
ON TABLE HOLD
END
DEFINE FILE HOLD
DUMMY/A1='';
ASALES/D10=ABS(SALES);
ARETAIL/D10=ABS(RETAIL_COST);
AZERO/D10=ABS(ZERO);
END
TABLE FILE HOLD
SUM ASALES
ARETAIL
AZERO
ON TABLE HOLD AS NPR FORMAT ALPHA
END
-RUN
? HOLD NPR
-READ NPR &PRSAL.I10. &PRRET.I10. &PRZER.I10.
-TYPE &PRSAL &PRRET &PRZER
-SET &PR1=IF &PRSAL EQ 0 THEN 'NOPRINT' ELSE '';
-SET &PR2=IF &PRRET EQ 0 THEN 'NOPRINT' ELSE '';
-SET &PR3=IF &PRZER EQ 0 THEN 'NOPRINT' ELSE '';
TABLE FILE HOLD
SUM SALES &PR1
RETAIL_COST &PR2
ZERO &PR3
BY COUNTRY
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
Hi Francis, This solution looks fine but perhaps it wont be feasible for my report as i've about 25 columns in my report with about 10 BY clauses and 2 ACROSS clauses. Is there some alternate way ?