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.
Hi all I'm trying to get a crosstab that would be similar to a sales by product type, with region as the across column. Here's the twist: 1. I need to display a subset of all the regions 2. I need to add an Average Sales column at the end, for each row, that averages all the regions, including the ones not displayed.
I've tried the trick of multiple verbs:
TABLE FILE A SUM AVE.SALES NOPRINT BY PRODTYPE SUM SALES BY PRODTYPE ACROSS REGION COLUMNS 'WEST' AND 'EAST' COMPUTE AVGSALES/P10.2 = C1; END
...but the average is only for the 2 regions specified, as opposed to all regions.
You can do this but in two steps. first calculate the average for the whole selection keep that in a hold file and then do a join with the original and the hold file to perform the end result.
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
Mark: Another way is to do your 2 verb calc (changing the across to by) without any selection put that to a hold file and then use a Where statement as Frank suggests on the Hold file to just show the regions you want. The Avg_Sales will still be for all regions.
Greg
current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11
OK, thanks. I was thinking that might be the case. As a follow up, is it possible to use "OVER" in the row summary for across? For example,
TABLE FILE CAR SUM RCOST NOPRINT DCOST NOPRINT COMPUTE COL1 = RCOST + DCOST; NOPRINT COMPUTE COL2 = AVE.SALES; NOPRINT BY COUNTRY BY CAR SUM COMPUTE TOTAL = RCOST + DCOST; OVER COMPUTE NUMBER = SALES; BY COUNTRY BY CAR ACROSS BODYTYPE COMPUTE TOTAL1 = C3; OVER COMPUTE TOTAL2 = C4; END
Verbose Solution I Love Define and I Don't much like Across So With Dialogue Manager I Set The Columns I Want to see : ®ION1 -> EAST, ®ION2 -> WEST (0 -> TOTAL) DEFINE FILE A -REPEAT FDEFSALES FOR &INDREG FROM 1 TO 2 ; SALES&INDREG/??? = IF REGION EQ '®ION.&INDREG' THEN SALES ELSE 0 ; -FDEFSALES END Your table Second VERB : SUM SALES NOPRINT -REPEAT FCUMSALES FOR &INDREG FROM 1 TO 2 ; SALES&INDREG AS '®ION.&INDREG' AND COMPUTE PCTSALES&INDREG/F6.2 = 100 * ( SALES&INDREG / SALES) -FCUMSALES ../.. The idea is to hold Focus Hand so that he does precisely what you intend him to do
I am an old fashioned parent who do not let enough autonomy to the brilliant child. On the other hand, some parents let their child do whatever they want. Be a clever parent, and drive Focus not too tight, not too light (and let him know he is NOT the boss)
Focus Mainframe 7.6.11 Dev Studio 7.6.11 and !!! PC Focus, Focus for OS/2, FFW Six, MSO