Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     <solved> how to get missing data to print

Read-Only Read-Only Topic
Go
Search
Notify
Tools
<solved> how to get missing data to print
 Login/Join
 
Platinum Member
posted
table file car
sum sales by country

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
 
Posts: 102 | Registered: April 20, 2004Report This Post
Virtuoso
posted Hide Post
SET ALL = ON ?


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Master
posted Hide Post
Yes, but only if your model is hierachical...


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Virtuoso
posted Hide Post
quote:
only if your model is hierachical

Viewing things from focus isn't it always hierarchical?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Master
posted Hide Post
Let me rephrase that...

...it only works if you have parent-child segment in you master/businessview.

Please correct me if I'm wrong, I'd like to use things like SET ALL = ON and WHERE INCLUDES/EXLCUDES.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Platinum Member
posted Hide Post
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
 
Posts: 102 | Registered: April 20, 2004Report This Post
Virtuoso
posted Hide Post
Is the db2 source a single table or a view?

You can check your db2 adapter parameter settings with this command:

SQL DB2 ?

You may get more information about how your FOCUS query is being processed by db2 by placing this command before your FOCUS query:

SQL DB2 SET EXPLAIN ON


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Platinum Member
posted Hide Post
it is a single table. thanks.


wf 7.6.11
unix aix
active reports, HTML, Excel, Text and PDF formats
 
Posts: 102 | Registered: April 20, 2004Report This Post
Expert
posted Hide Post
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
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
 
Posts: 822 | Registered: April 23, 2003Report This Post
Platinum Member
posted Hide Post
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
 
Posts: 102 | Registered: April 20, 2004Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Virtuoso
posted Hide Post
One final suggestion is to use:

SQL DB2 SET OPTIMIZATION OFF

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, 2007Report This Post
Platinum Member
posted Hide Post
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
 
Posts: 102 | Registered: April 20, 2004Report This Post
Virtuoso
posted Hide Post
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, 2005Report This Post
Platinum Member
posted Hide Post
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
 
Posts: 102 | Registered: April 20, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     <solved> how to get missing data to print

Copyright © 1996-2020 Information Builders