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] Percentage and IF statement

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Percentage and IF statement
 Login/Join
 
Platinum Member
posted
I need to show a percentage IF the county is greater then zero. I tried this code but it comes back "RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD".

code
  
PCT_HO_POL/D3%=HO_REMN_POL_LMT / HO_POL_LMT;

PCT_HO_POL1/A6V=IF AGT_CTY_CD GT '0' AND HO_POL_LMT1 EQ '000000' AND HO_REMN_POL_LMT1 EQ '000000' THEN ' ' ELSE PCT_HO_POL ;


All help is greatly appriciated!!!
Thank you in advance.

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


WEBFOCUS 7.6.4
Server: WINXP
 
Posts: 121 | Registered: September 20, 2007Report This Post
Virtuoso
posted Hide Post
You cannot assign a numeric field to an alpha field that way.

Do a search on PTOA and/or FTOA function which allows you to convert numbers to alphanumeric values.

- Neftali.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
quote:
FTOA

I will do research on these Thank You. But the user does want the % sign on the report. Frowner


WEBFOCUS 7.6.4
Server: WINXP
 
Posts: 121 | Registered: September 20, 2007Report This Post
Virtuoso
posted Hide Post
You'll find out that FTOA allows you to use "any" valid numeric format and assign it to a alpha field. No worries, it'll work!



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
quote:
PCT_HO_POL1/A6V=IF AGT_CTY_CD GT '0' AND HO_POL_LMT1 EQ '000000' AND HO_REMN_POL_LMT1 EQ '000000' THEN ' ' ELSE PCT_HO_POL ;


what about
PCT_HO_POL1/D3% MISSING ON =IF AGT_CTY_CD GT '0' AND HO_POL_LMT1 EQ '000000' AND HO_REMN_POL_LMT1 EQ '000000' THEN MISSING ELSE PCT_HO_POL ;




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
You can also try this approach:

DEFINE FILE CAR
PCT_HO_POL/D5%  = IF COUNTRY EQ 'JAPAN' THEN 0 ELSE (SALES / SALES * SEATS);
PCT_FMT/A8      = IF COUNTRY EQ 'JAPAN' THEN 'I6L' ELSE 'D5%';
END
TABLE FILE CAR
PRINT COUNTRY
      PCT_HO_POL/PCT_FMT
END


The advantage of this one over the use of FTOA is that you'll be still dealing with actual numbers so they can be used in SUBTOTALs a/o TOTALs in the report.

Hope that helps,
- Neftali.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
quote:
Originally posted by susannah:
quote:
PCT_HO_POL1/A6V=IF AGT_CTY_CD GT '0' AND HO_POL_LMT1 EQ '000000' AND HO_REMN_POL_LMT1 EQ '000000' THEN ' ' ELSE PCT_HO_POL ;


what about
PCT_HO_POL1/D3% MISSING ON =IF AGT_CTY_CD GT '0' AND HO_POL_LMT1 EQ '000000' AND HO_REMN_POL_LMT1 EQ '000000' THEN MISSING ELSE PCT_HO_POL ;


This got me very close to what they are requesting. It places a period (.) in the field. :-)

Thanks for all the quick responses. I will try some of the otheres as well.

Again Thank you! I'm so close now. Big Grin


WEBFOCUS 7.6.4
Server: WINXP
 
Posts: 121 | Registered: September 20, 2007Report This Post
Platinum Member
posted Hide Post
WOOHOO!! Did a SET NODATA =' ' and that completed my task!!!

THANK YOU EVERYONE!!!

Have a great weekend!


WEBFOCUS 7.6.4
Server: WINXP
 
Posts: 121 | Registered: September 20, 2007Report 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] Percentage and IF statement

Copyright © 1996-2020 Information Builders