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] Recomputing computed column as percent

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Recomputing computed column as percent
 Login/Join
 
Platinum Member
posted
I currently have this compute which compares a headcount from the previous year to the current year.

 COMPUTE inc_dec_oct/I3 = HEAD_COUNT.OCT_13 - HEAD_COUNT.OCT_12; AS Inc/Dec  


Displays this:

Job Title Oct 12 Oct 13 Inc/Dec

Cook 5 3 -2

I would like to add a percent column to get this:

Job Title Oct 12 Oct 13 Inc/Dec Percent

Cook 5 3 -2 (40%)

Adding this gives me a percent but its backwards. I am getting 60% not (40%)

 COMPUTE oct_perct/I3% = (HEAD_COUNT.OCT_12/HEAD_COUNT.OCT_13) * 100; AS Percent  


Also the headcount can go up so maybe I need a DEFINE with some IF GT or IF LT to get the proper percentage?

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


prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL

 
Posts: 133 | Location: Orlando, FL | Registered: August 04, 2005Report This Post
Virtuoso
posted Hide Post
quote:
COMPUTE oct_perct/I3% = (HEAD_COUNT.OCT_12/HEAD_COUNT.OCT_13) * 100; AS Percent


This shows the percentage of oct_12 in oct_13. What you say you say you want is the decrease.
So use:
  
COMPUTE oct_perct/I3% = ((HEAD_COUNT.OCT_13 -HEAD_COUNT.OCT_12)/HEAD_COUNT.OCT_13) * 100; AS Percent

However you will have to take into account the difference between decrease and increase.


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
Platinum Member
posted Hide Post
quote:

However you will have to take into account the difference between decrease and increase.


I think I will a DEFINE to determine GT and LT.


prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL

 
Posts: 133 | Location: Orlando, FL | Registered: August 04, 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     [SOLVED] Recomputing computed column as percent

Copyright © 1996-2020 Information Builders