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     No rows in Web Focus

Read-Only Read-Only Topic
Go
Search
Notify
Tools
No rows in Web Focus
 Login/Join
 
Platinum Member
posted
I am doing something like this

TABLE FILE
COUNT *
WHERE
END

It gves me the count if there are records matching the condition but if there are no records i want it to print

COUNT *
-------
0

Is this possible?
 
Posts: 109 | Registered: January 31, 2006Report This Post
Master
posted Hide Post
Hope this is what you are trying to do,

TABLE FILE CAR
COUNT *
WHERE CAR EQ 'BMW'
ON TABLE HOLD AS TEST
END
-RUN

-IF &LINES EQ 0 THEN GOTO SHOW ELSE GOTO SHOW1;
-SHOW
-TYPE ZERO RECORDS
-EXIT
-SHOW1
-TYPE &LINES RECORDS
-EXIT


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 2005Report This Post
Platinum Member
posted Hide Post
No this is not what i want. Basically i want the report to be in a hold file with the value 0..

In the sense
TABLE FILE ABC
COUNT *
WHERE FALSE CONDITION
ON TABLE HOLD AS H2
END

TABLE FILE H2
PRINT *
END

OUTPUT SHOULD BE

COUNT(*)
--------
0
 
Posts: 109 | Registered: January 31, 2006Report This Post
<Special-K>
posted
Why dont you define a field and use SUM?

DEFINE FILE CAR
WCOUNT/I5 = IF THEN 1 ELSE 0;
END

TABLE FILE CAR
SUM WCOUNT
END
 
Report This Post
Expert
posted Hide Post
If all you want is for WF to show the report and not a screen showing no records e.g. No HTML Output NUMBER OF RECORDS IN TABLE= 0 LINES= 0, then you can SET EMPTYREPORT = ON.

This will ensure that the report is always shown but if you have no output for your report then the report will just be blank with column headings (and not show your suggestion of 0 under the COUNT column heading)!

The common method of achieving an empty report scenario is to issue a -RUN after your report and then check the value of &LINES. If the value is zero then redirect the code stream to an HTMLFORM that displays a report stating that the selection criteria produced no records. If the report has data to be shown then just show the report as usual -
-*SET EMPTYREPORT = ON
TABLE FILE CAR
WRITE CNT.MODEL
WHERE COUNTRY EQ 'CHINA'
ON TABLE PCHOLD AS MYREPORT FORMAT HTMLTABLE
END
-RUN
-IF &LINES EQ 0 THEN :NoReport;
-* If the code stream gets here then the report will be displayed
-HTMLFORM MYREPORT
-GOTO :NowExit;
-:NoReport
-HTMLFORM BEGIN
<html><head><title>Emptry Report</title></head>
<body>
The selection criteria produced no data for the report
</body></html>
-HTMLFORM END
-:NowExit


Of course you can go one step further and check for &FOCERRNUM being non zero and redirect to an HTMLFORM showing that the code had errors within it as well, but I'll leave you to work that one out Wink.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Thanks Tony. It worked.
 
Posts: 109 | Registered: January 31, 2006Report 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     No rows in Web Focus

Copyright © 1996-2020 Information Builders