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 would like to use a subtotal value in a define to claculate what percent of a hundred the cost is, or how much of the total cost does this expense represent of out 100
Now what if i wanted it summed for every subtotoal
TITLE__COSTS_____PERCENT A______2_________5.4% _______5_________13.5% _______6_________16.2% _______1_________2.7% _______3_________8.1% _______8_________21.6% _______5_________13.5 _______7_________18.9 TOTAL of A _______37________100
TITLE__COSTS_____PERCENT B______2_________5.4% _______5_________13.5% _______6_________16.2% _______1_________2.7% _______3_________8.1% _______8_________21.6% _______5_________13.5 _______7_________18.9 TOTAL of B _______37________100
DEFINE FILE CAR
TOTDC/D12.2=DEALER_COST;
SUBTOTDC/D12.2=DEALER_COST;
END
TABLE FILE CAR
SUM TOTDC NOPRINT
SUM
SUBTOTDC NOPRINT
BY COUNTRY
SUM
DEALER_COST
COMPUTE CPCT/D15.1 = DEALER_COST / SUBTOTDC*100; AS 'country,pct'
COMPUTE TOTPCT/D15.1 = DEALER_COST / TOTDC*100; AS 'overall,pct'
BY COUNTRY
BY CAR
ON COUNTRY SUBTOTAL AS 'subtotal'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE COLUMN-TOTAL
END
The only thing is that you also see a total of the percentage CPCT, that I would love to surpress. Maybe somebody has a suggestion for this
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
I have been messing around with your code and get it to work, tried using it with and without the NOPRINT... However,
When i try to use the same concept on my current report it still gives me the error, so then I take it out and can get it to run showing all the data i want just doesnt have the last column with the percentages
SUM IN_ITEMCODE/I7 AS 'ItemCode' IN_COMCLASS AS 'CC' IN_DESC AS 'Item Description' IN_PACK AS 'Pack' IN_SIZE AS 'Size' IN_QTY AS 'Cases Del.' IN_SELL_UNITS AS 'Time Del.' UnitMove AS 'Unit Move' totCost AS 'Total Amount Paid' totSRP AS 'Total Sell Value' AVE.PercProf AS '% Profit' TotalProfit ----------------------------- would like to add percentages here for "totCost/ subtotoal.totCost" BY IN_COMCLASS ----------------------------- BY DEPARTMENTCODE NOPRINT BY IN_COMCLASS NOPRINT BY IN_ITEMCODE NOPRINT ON IN_COMCLASS SUBTOTAL IN_QTY totCost totSRP AS '*TOTAL' HEADING "" FOOTING ""
DEFINE FILE DETAIL
CustNo/I6=IN_CUSTNO;
totSRP/D12.2=IN_PACK* IN_SRP;
UnitMove/I5=IN_QTY * IN_PACK;
totCost/D12.2=IN_UNITCOST * IN_PACK;
PercProf/D12.2=((IN_SRP - IN_UNITCOST) / IN_SRP)*100;
TotalProfit/D12.2=(totSRP - totCost);
subtotcost/D12.2=totCost;
END
TABLE FILE DETAIL
SUM SUBTOTCOST NOPRINT
BY DEPARTMENTCODE NOPRINT
BY IN_COMCLASS NOPRINT
SUM
IN_ITEMCODE/I7 AS 'ItemCode'
IN_COMCLASS AS 'CC'
IN_DESC AS 'Item Description'
IN_PACK AS 'Pack'
IN_SIZE AS 'Size'
IN_QTY AS 'Cases Del.'
IN_SELL_UNITS AS 'Time Del.'
UnitMove AS 'Unit Move'
totCost AS 'Total Amount Paid'
totSRP AS 'Total Sell Value'
AVE.PercProf AS '% Profit'
TotalProfit
-*----------------------------
COMPUTE PCTTOT/D9.2%=totCost/SUBTOTCOST;
-*-----------------------------
BY DEPARTMENTCODE NOPRINT
BY IN_COMCLASS NOPRINT
BY IN_ITEMCODE NOPRINT
ON IN_COMCLASS SUBTOTAL
IN_QTY
totCost
totSRP AS '*TOTAL'
HEADING
""
FOOTING
""
END
this should work well
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006