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] altering negative percentages

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] altering negative percentages
 Login/Join
 
Silver Member
posted
Hi,

Not sure why I'm struggling with this but I have the following compute:

 COMPUTE DAILY_COMPLLY/P7.1%B =IF  ( DAILY_TY - DAILY_LY ) / DAILY_LY * 100 GT 100.0 THEN 100.0 ELSE IF  ( DAILY_TY - DAILY_LY ) / DAILY_LY * 100 GT -100.0 THEN -100.0  ELSE  ( DAILY_LY_LLY_COMP - DAILY_LLY_COMP ) / DAILY_LLY_COMP * 100; AS ''  


Altering any positive percentages above 100% work fine, displays as 100.0% even if its really (2500.0%) but I can't get it to work with any negative percentage. So I need a -2500.0% to display as -100.0%.

Can someone help me with this. GT or LT does not work. GT display every row of data to -100.0% and LT does nothing at all.

Thanks in advance
Cathy

This message has been edited. Last edited by: <Kathryn Henning>,


WEBFOCUS 7.14
WEBFOCUS.8.04
 
Posts: 44 | Registered: March 30, 2007Report This Post
Virtuoso
posted Hide Post
quote:
ELSE IF ( DAILY_TY - DAILY_LY ) / DAILY_LY * 100 GT -100.0


It seems to me that part above should use LT instead of GT. Are you saying you tried that and it didn't work?



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Platinum Member
posted Hide Post
Try increasing the size of your defined field to P9 ......


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com

 
Posts: 191 | Location: Henderson, Nevada | Registered: April 29, 2003Report This Post
Member
posted Hide Post
Lets look at your logic this way:

COMPUTE DAILY_COMPLLY/P7.1%B =
option 1) IF ( DAILY_TY - DAILY_LY ) / DAILY_LY * 100 GT 100.0 THEN 100.0 ELSE
option 2) IF ( DAILY_TY - DAILY_LY ) / DAILY_LY * 100 GT -100.0 THEN -100.0 ELSE
option 3) ( DAILY_LY_LLY_COMP - DAILY_LLY_COMP ) / DAILY_LLY_COMP * 100; AS ''

example1 : value = 2500.0% --> this falls under option 1 line so the answer will be 100.0%
example2 : value = 50.0% --> this falls under option 2 line so the answer will be -100.0%
example3 : value = -50.0% --> this falls under option 2 line so the answer will be -100.0%
example4 : value = -2500.0% --> this falls under option 3 line so the answer will be the calculation

I believe John is correct and in option 2 line you need to change 'GT' to 'LT' and the result will be:


COMPUTE DAILY_COMPLLY/P7.1%B =
option 1) IF ( DAILY_TY - DAILY_LY ) / DAILY_LY * 100 GT 100.0 THEN 100.0 ELSE
option 2) IF ( DAILY_TY - DAILY_LY ) / DAILY_LY * 100 LT -100.0 THEN -100.0 ELSE
option 3) ( DAILY_LY_LLY_COMP - DAILY_LLY_COMP ) / DAILY_LLY_COMP * 100; AS ''

example1 : value = 2500.0% --> this falls under option 1 line so the answer will be 100.0%
example2 : value = 50.0% --> this falls under option 3 line so the answer will be the calculation
example3 : value = -50.0% --> this falls under option 3 line so the answer will be the calculation
example4 : value = -2500.0% --> this falls under option 2 line so the answer will be -100.0%


All Releases
All OS, All Outputs
 
Posts: 15 | Registered: October 24, 2014Report This Post
Silver Member
posted Hide Post
Thank you all for the input the LT did work. Thought I had tried it and was getting incorrect results. But its working now.

Again, thanks for all your help.


WEBFOCUS 7.14
WEBFOCUS.8.04
 
Posts: 44 | Registered: March 30, 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] altering negative percentages

Copyright © 1996-2020 Information Builders