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     Suppress decimal if zero

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Suppress decimal if zero
 Login/Join
 
Platinum Member
posted
I have a compute field as:

COMPUTE NEWF2BUDGETYIELD/D20.1 = F2BUDGETYIELD * 100;

Now, it always displays the result as defined:

Value: 99
Display: 99.0

Value: 99.5
Display: 99.5

Is there a way to suppress the decimal portion of it is zero (99 instead of 99.0)?

Thanks,
Dan


Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10
QA: WebFOCUS 7.6.10, Data Migrator 7.6.10
Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8
Windows 2K3, Tomcat 5.5.17, IIS 6
Usage: HTML, PDF, Excel, Self-serve, BID and MRE
 
Posts: 197 | Location: Roseville, CA | Registered: January 24, 2005Report This Post
Virtuoso
posted Hide Post
Take a look at the discussion "creating dynamically formatted fields"

and see this example

DEFINE FILE CAR
MYFORMAT/A8=DECODE COUNTRY ('ENGLAND' 'P15.2C' 'JAPAN' 'P15' ELSE 'P15.2M');
END

TABLE FILE CAR
SUM SALES/MYFORMAT 
BY COUNTRY
END


that does whta you need...




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Virtuoso
posted Hide Post
Frank is correct, and to get this to work on COMPUTED fields needs an extra step:
TABLE FILE CAR
SUM RCOST DCOST
COMPUTE 
PCT/D12.2 = ((RCOST-DCOST)/DCOST)*100; NOPRINT
FMT/A8 = IF INT(PCT) EQ PCT THEN 'F3' ELSE 'F4.1'; NOPRINT
PCT/FMT
BY COUNTRY
BY CAR
END
However that right justifies and looks bad IMO.

TABLE FILE CAR
SUM RCOST DCOST
COMPUTE 
PCT/D12.2 = ((RCOST-DCOST)/DCOST)*100; NOPRINT
ALPHA1/A6 = FTOA(PCT,'(D5.1)','A6'); NOPRINT
ALPHA2/A6 = FTOA(PCT,'(D5)','A6'); NOPRINT
DISPLAY/A6 = IF INT(PCT) EQ PCT THEN ALPHA2 ELSE ALPHA1;
BY COUNTRY
BY CAR

may well work for you.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Platinum Member
posted Hide Post
Thanks Frank and Alan for your suggestions. I was able to get my results using Alan's first example.


Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10
QA: WebFOCUS 7.6.10, Data Migrator 7.6.10
Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8
Windows 2K3, Tomcat 5.5.17, IIS 6
Usage: HTML, PDF, Excel, Self-serve, BID and MRE
 
Posts: 197 | Location: Roseville, CA | Registered: January 24, 2005Report 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     Suppress decimal if zero

Copyright © 1996-2020 Information Builders