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] Want % sign when using PCT.CNT

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Want % sign when using PCT.CNT
 Login/Join
 
Member
posted
How do I get a % sign to display when using PCT.CNT?

Example:
TABLE FILE CAR
SUM
CNT.MODEL AS 'MODEL COUNT'
PCT.CNT.MODEL/D8.2% AS 'PERCENT'
BY CAR
END

Results:
CAR MODEL COUNT PERCENT
ALFA ROMEO 3 16.67
AUDI 1 5.56
BMW 6 33.33
DATSUN 1 5.56
JAGUAR 2 11.11
JENSEN 1 5.56
MASERATI 1 5.56
PEUGEOT 1 5.56
TOYOTA 1 5.56
TRIUMPH 1 5.56

I want to see:
ALFA ROMEO 3 16.67%
AUDI 1 5.56%
...

Thanks,

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


Version 769
Windows XP
PDF
 
Posts: 7 | Registered: July 28, 2009Report This Post
Expert
posted Hide Post
Unfortunately, according to the documentation,
quote:
PCT.CNT. - Computes a field's percentage based on the number of instances found. The format of the result is always F6.2 and cannot be reformatted.


You could have an intermediary HOLD file:

SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
TABLE FILE CAR
SUM
CNT.MODEL AS 'MODEL_COUNT'
PCT.CNT.MODEL AS 'PERCENT'
BY CAR
ON TABLE HOLD AS HOLDCAR
END
TABLE FILE HOLDCAR
SUM 
MODEL_COUNT AS 'MODEL_COUNT'
PERCENT/D8.2% AS 'PERCENT'
BY CAR
END


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
Member
posted Hide Post
Thanks. I was hoping there was some kind of Jack O'Neill trick to avoid the extra steps.


Version 769
Windows XP
PDF
 
Posts: 7 | Registered: July 28, 2009Report This Post
Expert
posted Hide Post
One extra step doesn't hurt!


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
Virtuoso
posted Hide Post
How about using COMPUTE?
  
TABLE FILE CAR
SUM
CNT.MODEL AS 'MODEL COUNT'
PCT.CNT.MODEL NOPRINT
COMPUTE PCTCNT/D8.2%=PCT.CNT.MODEL;
 AS 'PERCENT'

BY CAR
END



No Extra Steps...


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
<Mary3001>
posted
Daniel, thanks for posting the easy way to do this. I just encountered this problem and was able to solve it using your solution. So simple, and my first time using the Text View instead of Report Painter to change something in a report! It did take me a few trys to get it right because I was using a crosstab which was complicating things. So I took off the crosstab, entered the text view solution and added the crosstab back in, and it worked perfectly.

Thanks again!
 
Report This Post
Expert
posted Hide Post
quote:
COMPUTE PCTCNT/D8.2%=PCT.CNT.MODEL;


WDITOT?


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
Virtuoso
posted Hide Post
Francis,

As in "Some like it hot", nobody is perfect!

Mary,

Welcome to the wonderful world of Focus. I've been at it for - yikes - 26 years, and I enjoy every day! Don't be shy and ask. But especially, never be afraid to try.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 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] Want % sign when using PCT.CNT

Copyright © 1996-2020 Information Builders