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     Percentages not adding up to 100?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Percentages not adding up to 100?
 Login/Join
 
Platinum Member
posted
Hi all,

I think I must be missing something quite straight forward here, but I cannot get my percentages to total 100. Thankfully I have been able to replicate it using the CAR example file, where the total is 99, in my work example it only gets to 98!

I think I need to retain decimal places, but no matter what formats I apply to the columns I only get whole number percentages and therefore it does not total 100...

TABLE FILE SALES
SUM
UNIT_SOLD
PCT.UNIT_SOLD AS 'PCT,UNIT_SOLD'
BY
CITY
ON TABLE COLUMN-TOTAL AS 'TOTAL'
END

I have found another thread that is similar, but unfortunately reading this hasn't helped me either!

https://forums.informationbuilders.com/eve/forums/a/tpc/...701033731#5701033731

Thanks Mark.


WebFocus 765. iSeries v5r4
 
Posts: 175 | Location: England | Registered: April 11, 2006Report This Post
Member
posted Hide Post
Hi Mark,

When working with percentages, you need to use a RECOMPUTE or SUMMARIZE, depending on your sort breaks. Check online doc for more info on these commands.
 
Posts: 11 | Location: Information Builders Inc | Registered: April 15, 2005Report This Post
Platinum Member
posted Hide Post
Hi Mark,

Here's an example using a defined field:

DEFINE FILE SALES
N_UNITS/D5.1 = UNIT_SOLD;
END
-*
TABLE FILE SALES
SUM
UNIT_SOLD
PCT.UNIT_SOLD AS 'PCT,UNIT_SOLD'
PCT.N_UNITS AS 'PCT,N_UNITS'
BY
CITY
ON TABLE COLUMN-TOTAL AS 'TOTAL'
END

Jim


WF DevStu 5.2.6/WF Srv 5.2.4/Win NT 5.2
 
Posts: 118 | Location: Lincoln Nebraska | Registered: May 04, 2005Report This Post
Virtuoso
posted Hide Post
The issue is your percentage is based on a field that has no decimal places so truncation/rounding occurs. Using Jim's example or this one below gives decimal places and the 100 now shows. Oh and COLUMN-TOTAL gives 100 in this example as well.

DEFINE FILE SALES
UNITX/D7.2 = UNIT_SOLD;
END
TABLE FILE SALES
SUM UNITX
PCT.UNITX
BY
CITY
ON TABLE RECOMPUTE AS 'TOTAL'
END


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Platinum Member
posted Hide Post
Aha I see it. I was changing the format of how the field was displayed, but not actually how it was used by WebFocus, hence the need for the new defined field.

Excellent, many thanks all Smiler

...


I also have another quick question that I would really like to sneak in here if possible....

I have a column that contains a value in seconds. I perform an EDIT function on this column to format it into HH:MM:SS. However this HH:MM:SS value does not get totalled as it is an Alpha field. Is there a way to reference the total nunber of seconds without first building a hold file, so I can create TOTAL SECONDS in HH:MM:SS?

Many thanks again Smiler


WebFocus 765. iSeries v5r4
 
Posts: 175 | Location: England | Registered: April 11, 2006Report This Post
Expert
posted Hide Post
mark, i think leah et.al. all would agree that you would have to keep the original seconds variable as an integer, in order for it to sum




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
Mark,

The important thing to do here is to use a numeric format of 'F' or 'D' for the percentage field. If you use either of these formats, it does not matter if you show any decimal positions. This is because the decimal places will exist in storage eventhough you will not show them on your report. since the decimal places exist in storage, the 100% will be calculated correctly.

Compare the following two reports. Both calculate 100% as the total percentage because the numeric format of UNITX is 'D'.

DEFINE FILE SALES
UNITX/D7.2 = UNIT_SOLD;
END
TABLE FILE SALES
SUM UNITX
PCT.UNITX
BY
CITY
ON TABLE RECOMPUTE AS 'TOTAL'
END

DEFINE FILE SALES
UNITX/D7 = UNIT_SOLD;
END
TABLE FILE SALES
SUM UNITX
PCT.UNITX
BY
CITY
ON TABLE SUBTOTAL AS 'TOTAL'
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 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     Percentages not adding up to 100?

Copyright © 1996-2020 Information Builders