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 All, I have a requirement where I need a count based on the following requirement.
PA PV PS PE Count ----------------------- A 1 0 2001 1 A 1 0 2001 A 2 0 2002 1 B 1 0 2001 1 B 1 0 2001 1 ----------------------- Total Count:4 -----------------------
PA PV PS PE Count ----------------------- A 1 0 2001 1 A 1 0 2001 A 2 0 2002 1 B 1 0 2001 1 B 1 0 2001 ----------------------- Total Count:3 -----------------------
TABLE FILE .....
PRINT PV PS PE
AND COMPUTE MYCNTR/I9 = IF PV EQ LAST PV AND PS EQ LAST PS AND PE EQ LAST PE THEN 0 ELSE 1; AS 'Count'
BY PV NOPRINT
BY PS NOPRINT
BY PE NOPRINT
ON TABLE SUBFOOT
"Total Count: <TOT.MYCNTR "
...
END
Is there any similar command in Webfocus as that of COUNT(*) in oracle ? I need to get the total record count and if the count is 0 I need to do some other branching.
Can any body help me ?
Regards, Johney.
Version 7.6.11 Webfocus installed in AIX 5.3, desktop PC: Windows-XP based Output: Excel, HTML, PDF
Be sure to check the SQL produced (using the method that Francis has posted so many times before), to ensure that you do not end up issuing a request that results in a table space scan
... or use SQL passthru.
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, 2004
You can also do: TABLE FILE CAR COUNT * END If you are wanting to do conditional branching when there are no records, you might want to place a -RUN command after your request and then -IF &LINES EQ 0 GOTO myroutine;This message has been edited. Last edited by: PBrightwell,
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007
You have to be mindful of the SQL being produced in the background and therefore being passed to the RDBMS.
For instance, you would think that SUM CNT.field, WRITE CNT.field or COUNT * would all produce the same SQL as they are basically synonyms. Well they haven't always.
WRITE CNT.field was the only method of ensuring COUNT(*) being produced in the MVS DB2 interface at one time, hence the suggestion that the SQL is trapped before running in anger to ensure that no table space scan would be performed in getting the results.
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, 2004
msam have you experimented with count distinct ? SUM CNT.DST.PA which gives you the count of the distincly different values in your PA field, which seems to be what you're doing. -s.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003