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.
when there is no sales data for a particular country, that country will not print.
I recall there is a way to make it print; ie, country with 0 sales. I just can't remember what it is. Can someone tell me what it is? Thanks in advance.This message has been edited. Last edited by: mike,
wf 7.6.11 unix aix active reports, HTML, Excel, Text and PDF formats
it is a db2 database table; so, I am not sure if it is considered hierarchical. But, I have tried set all = on. It did not work (makes no difference). I think set all = on applies in situation where you have a join. When there is no join involved, that does not do a thing?
wf 7.6.11 unix aix active reports, HTML, Excel, Text and PDF formats
Two programming methods to manufacture rows for which there are none.
1) Use the "Specifying Your Own Sort Order" technique:
-SET &ECHO=ALL;
TABLE FILE CAR
SUM
COUNTRY BY COUNTRY NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HCOUNTRY
END
-RUN
-SET &NBR_COUNTRY = &LINES;
-* ONE LESS READFILE IN THE REPEAT STATEMENT
-SET &NBR_COUNTRY = &NBR_COUNTRY - 1;
TABLE FILE CAR
SUM
SALES
BY COUNTRY ROWS
-READFILE HCOUNTRY
'&COUNTRY'
-REPEAT ENDHCOUNTRY &NBR_COUNTRY TIMES
-READFILE HCOUNTRY
OVER '&COUNTRY'
-ENDHCOUNTRY
END
-RUN
2) Use the MORE command:
-SET &ECHO=ALL;
TABLE FILE CAR
SUM
COMPUTE SALES/I6 = 0;
BY COUNTRY
ON TABLE HOLD AS HCOUNTRY
END
-RUN
TABLE FILE CAR
SUM
SALES
BY COUNTRY
MORE
FILE HCOUNTRY
END
-RUN
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
If I understand you correctly.. 1. 'car' is DB2 table. 2. car.SALES can contain NULL. 3. You would like to treat car.SALES as being zero (0), when it is NULL.
I'd be tempted to create a DEFINE field and set it to SALES when SALES is not NULL (missing) and to zero (0) when SALES is NULL (missing).
Then replace SALES with your DEFINE field, within your TABLE command.
Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
thank you, Francis. I believe #2 will work. I am not sure how #1 will work because the first hold file HCOUNTRY will certainly not contain the zero sales country. What good is it to loop through the country values in the HCOUNTRY file?
Besides, it looks awfully performance poor if it is a big file with lots of countries to loop through.
wf 7.6.11 unix aix active reports, HTML, Excel, Text and PDF formats
You could try PRINTing the records to a HOLD file. PRINT might extract all of the records (including those with missing values) and you could then apply your SUM to the HOLD file. But since WebFOCUS will do the summing instead of DB2, performance could be affected if it's a large result set.
Another idea is to add a field to your original SUM query that always has a value. For example:
TABLE FILE CAR
SUM
CAR NOPRINT
SALES
BY COUNTRY
END
or even....
TABLE FILE CAR
SUM
COUNTRY
SALES
BY COUNTRY NOPRINT
END
EDIT: By the way, David Briars suggestion of using a DEFINE should also work.This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
This will cause aggregation to be done by WebFOCUS and DB2 should pass all values that meet the selection criteria. This has the same disadvantage as using PRINT, in that performance could be adversely affected for large result sets.This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
thanks Dan for the suggestions. Our file is huge here and performance is important. My issue is not so much that a particular field has no value. Rather, there is no record (or row) for a particular country value. For example, say, there is nothing for country China at all. China will not show up in the report.
wf 7.6.11 unix aix active reports, HTML, Excel, Text and PDF formats
If you have a ready cheap source (e.g., dimension table) that can provide the list of key values, MATCH FILE can be used to force in any missing key values.
The penalty paid is the merge phase of MATCH (which in this case should be tolerable), and the need to HOLD and TABLE from HOLD (which you may be doing regardless).
The other columns in the forced-in rows will be zero, blank, or MISSING, depending how they are defined.
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
a great idea, j. Yes, we have a dimension ready to use. This will work. I have to say, though, initially I was not doing a hold file. It was a straight TABLE FILE... SUM .. BY ...
But, it is a small price to pay.
Thanks all for all the wonderful suggestions.
wf 7.6.11 unix aix active reports, HTML, Excel, Text and PDF formats