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     [CLOSED] How to get percent by getting this subtotal divide another subtotal.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] How to get percent by getting this subtotal divide another subtotal.
 Login/Join
 
Platinum Member
posted
My issue is I have to calculate the percentage by dividing the subtotal of column A to (subtotal of column B + subtotal of column C) and display it in the header. This is my sample source code:
 
TABLE FILE TABLE_TEMP
SUM
   CNT.FIELDA WITHIN FIELDB WITHIN FIELDC
BY LOWEST FIELDD NOPRINT
BY LOWEST FIELDB
ACCROSS LOWEST FIELDC
ON FIELDD SUBTOTAL AS '*TOTAL'
HEADING
"Percentage:  "
ON TABLE PCHOLD FORMAT HTML

The result I got is:
FIELDB    FIELDC_VALUE1     FIELDC_VALUE2    FIELDC_VALUE3
ValueA     4                    2                3
ValueB     5                    1                7
ValueC     6                    3                2
*Total     15                   6                12

The requirement I got is I need to calculate the percentage based on the total I got : 15 / ( 6 + 12) = 83% then display 83% in the HEADING.

Could you guys please help me out on this issue?
Thanks in advance.

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


WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 125 | Registered: June 17, 2013Report This Post
Virtuoso
posted Hide Post
Have you tried a multi-verb request?



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
I agree with my friend "New Jersey" , multi verb requests are easier [for my brain] to understand; and also, note that whenever you want to put a calculated thing into a heading, then put the HEADING commands at the bottom your your fex, after all the crunching. That way, the reporting matrix actually has access to the number you've just crunched.




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
Platinum Member
posted Hide Post
To be honest, I don't know how to use multi-verb in my case. I am trying to get something like C1 / (C2 + C3) to get the total value of each column but no luck. The ACROSS makes a litlle bit confuse here, I can't get Total value of column 1 or 2.


WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 125 | Registered: June 17, 2013Report This Post
Expert
posted Hide Post
use the car file, when you want to give an example.
SET ASNAMES = ON
TABLE FILE CAR
SUM SALES AS TOTSALES
SUM SALES AS SUBTOTSALES
BY COUNTRY
SUM SALES BY COUNTRY BY CAR
END
now take a look at what you have in the 3 data columns, and see how easy it is now to make calculations of shares.
If you do this sort of thing in a single pass at the data, you can use NOPRINTS on the totals columns, but they're still available to use.
remember with mutliple verbs that the BY fields must match:
BY a
BY a BY b
BY a BY b BY c, etc.




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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] How to get percent by getting this subtotal divide another subtotal.

Copyright © 1996-2020 Information Builders