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     across with row summary

Read-Only Read-Only Topic
Go
Search
Notify
Tools
across with row summary
 Login/Join
 
Platinum Member
posted
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.

Any ideas? Thanks.


Thanks.

Mark
WF 7.6 Windows
 
Posts: 150 | Registered: July 26, 2007Report This Post
Virtuoso
posted Hide Post
quote:
COLUMNS 'WEST' AND 'EAST'


This statement acts in fact as a "where clause"

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, 2006Report This Post
Guru
posted Hide Post
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

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
 
Posts: 274 | Location: Boston/New England | Registered: February 12, 2006Report This Post
Platinum Member
posted Hide Post
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

Seems to almost work.


Thanks.

Mark
WF 7.6 Windows
 
Posts: 150 | Registered: July 26, 2007Report This Post
Platinum Member
posted Hide Post
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
 
Posts: 134 | Registered: November 06, 2007Report This Post
Platinum Member
posted Hide Post
Why '&'REGION.&INDREG turned into ®ION.&INDREG, I really don't know


Focus Mainframe 7.6.11
Dev Studio 7.6.11 and !!!
PC Focus, Focus for OS/2, FFW Six, MSO
 
Posts: 134 | Registered: November 06, 2007Report This Post
Expert
posted Hide Post
Becasue & REG is one of those shorthand codes to print special characters in HTML pages. Just like & nbsp; for a non blank space, etc. etc. etc.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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     across with row summary

Copyright © 1996-2020 Information Builders