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] Cant get a sum count to work.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Cant get a sum count to work.
 Login/Join
 
Gold member
posted
Im trying to get a count of distinct License_no and just cant seem to get it to print out right. It always comes out 0 on the subfoot ""Total Count:
Can anyone tell what im doing wrong?

Thanks.

TABLE FILE SQLOUT
PRINT 
     LEGAL_NAME AS 'Legal,Name'
     Business_Address AS 'Business,Address'
     Mailing_Address AS 'Mailing,Address'
     Phone_Number AS 'Phone,Number'
     LC_Return_Date/HMDYY AS 'Indicator,Effective,Date'
BY License_No AS 'License,Number'
BY Tax_Period AS 'Tax,Period'
BY TRADE_NAME AS 'Trade,Name'
     
ON License_No RECAP 
COUNT1/I9 = IF License_No EQ LAST License_No THEN 0 ELSE 1;
ON License_No SUBFOOT
" "
ON TABLE SUBFOOT
"Total Count: <TOT.COUNT1 "
WHERE Tax_Period EQ '&Tax_Period.(FIND TAX_PERIOD IN DBO_PERIOD).Tax_Period.';
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &FMT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *  

This message has been edited. Last edited by: Kerry,


WF 7.1.7- Windows XP
 
Posts: 63 | Registered: August 28, 2007Report This Post
Virtuoso
posted Hide Post
COUNT1 Needs to be a COMPUTE


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Expert
posted Hide Post
Erney,

I never do a RECAP that way; Use a multi-verb process. Also, ON TABLE will cause problems in later releases(so I have found), so I use DUMMY. Also, I changed your COUNT logic:
  
DEFINE FILE SQLOUT
  DUMMY/A1 = ' ';
END
TABLE FILE SQLOUT
SUM
   COMPUTE COUNT1/I9 = IF License_No EQ LAST License_No THEN COUNT1+1 ELSE 1; NOPRINT
  BY DUMMY NOPRINT
PRINT 
     LEGAL_NAME AS 'Legal,Name'
     Business_Address AS 'Business,Address'
     Mailing_Address AS 'Mailing,Address'
     Phone_Number AS 'Phone,Number'
     LC_Return_Date/HMDYY AS 'Indicator,Effective,Date'

BY DUMMY NOPRINT
BY License_No AS 'License,Number'
BY Tax_Period AS 'Tax,Period'
BY TRADE_NAME AS 'Trade,Name'
     
ON License_No SUBFOOT
" "
ON DUMMY SUBFOOT
"Total Count: <TOT.COUNT1 "

WHERE Tax_Period EQ '&Tax_Period.(FIND TAX_PERIOD IN DBO_PERIOD).Tax_Period.';

ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &FMT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *  

hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
Erney,

Sorry!! Had the COMPUTE backwards!!!!

  
DEFINE FILE SQLOUT
  DUMMY/A1 = ' ';
END
TABLE FILE SQLOUT
SUM
   COMPUTE COUNT1/I9 = IF License_No EQ LAST License_No THEN COUNT1 ELSE COUNT1+1; NOPRINT
  BY DUMMY NOPRINT
PRINT 
     LEGAL_NAME AS 'Legal,Name'
     Business_Address AS 'Business,Address'
     Mailing_Address AS 'Mailing,Address'
     Phone_Number AS 'Phone,Number'
     LC_Return_Date/HMDYY AS 'Indicator,Effective,Date'

BY DUMMY NOPRINT
BY License_No AS 'License,Number'
BY Tax_Period AS 'Tax,Period'
BY TRADE_NAME AS 'Trade,Name'
     
ON License_No SUBFOOT
" "
ON DUMMY SUBFOOT
"Total Count: <TOT.COUNT1 "

WHERE Tax_Period EQ '&Tax_Period.(FIND TAX_PERIOD IN DBO_PERIOD).Tax_Period.';

ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &FMT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE 


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Gold member
posted Hide Post
Interesting im getting a count of 2 back, even though there are a few hundred results.


WF 7.1.7- Windows XP
 
Posts: 63 | Registered: August 28, 2007Report This Post
Gold member
posted Hide Post
Oop nevermind, I got it

thanks a bunch again.


WF 7.1.7- Windows XP
 
Posts: 63 | Registered: August 28, 2007Report This Post
Expert
posted Hide Post
Hi Erney,

You are welcome, I guess? Did you have a typo or something else?

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Gold member
posted Hide Post
 DEFINE FILE SQLOUT
DUMMY/A1 = ' ';
END
TABLE FILE SQLOUT
SUM
     COMPUTE COUNT1/I9 = IF License_No EQ LAST License_No THEN COUNT1 ELSE COUNT1 + 1; NOPRINT
BY DUMMY NOPRINT
[B]BY License_No AS 'License,Number'[/B]
PRINT
     Tax_Period AS 'Tax,Period'
     TRADE_NAME AS 'Trade,Name'
     LEGAL_NAME AS 'Legal,Name'
     Business_Address AS 'Business,Address'
     Mailing_Address AS 'Mailing,Address'
     Phone_Number AS 'Phone,Number'
     LC_Return_Date/HMDYY AS 'Indicator,Effective,Date'
BY DUMMY NOPRINT
BY License_No AS 'License,Number'

ON DUMMY SUBFOOT
"Total Count: <COUNT1 "

ON License_No SUBFOOT
" "
WHERE Tax_Period EQ '&Tax_Period.(FIND TAX_PERIOD IN DBO_PERIOD).Tax_Period.';
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &FMT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE * 


Had to put
BY License_No AS 'License,Number'

after the BY DUMMY NOPRINT


WF 7.1.7- Windows XP
 
Posts: 63 | Registered: August 28, 2007Report This Post
Expert
posted Hide Post
AHHH!!! Well Done... AND, you changed TOT.COUNT1 to COUNT1..


Smiler


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | 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     [SOLVED] Cant get a sum count to work.

Copyright © 1996-2020 Information Builders