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.
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!
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, 2005
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, 2005
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, 2004
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
...
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
WebFocus 765. iSeries v5r4
Posts: 175 | Location: England | Registered: April 11, 2006
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, 2003