Focal Point
Computes Across Columns - GUI vs FOCUS

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/825106492

November 16, 2009, 01:48 PM
bcook278
Computes Across Columns - GUI vs FOCUS
I have created a simple focexec to return a year over year variance. The code looks like the below:

TABLE FILE ASSET_FACT_RDWSYS
SUM
ADM_TOT_UNITS_IN_SVC
BY PROGRAM_SHORT_DESC
ACROSS CALENDAR_YEAR_NBR
COMPUTE
VAR/D12 = C2-C1;
HEADING
""
FOOTING
""
WHERE CALENDAR_YEAR_NBR EQ 2008 OR 2009;


I am trying to recreate this in the GUI but can't seem to get the Compute to appear as a single column. It is consistently appearing to the right of each across column when I only want it to appear once. In the code it appears to be placing the compute in the SUM rather then under the ACROSS as shown in the code. Is there a way to get this to work in the GUI. I am guessing I may simply not be doing something correctly when creating my COMPUTE.


WebFOCUS 7.6.8
WebFOCUS Client and Server running on RedHat Linux, Developer Studio on Windows XP
All output formats
November 16, 2009, 01:57 PM
Francis Mariani
In Dev Studio Report Painter:

Report > Output > Check "Show Row Totals" checkbox


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 16, 2009, 03:06 PM
Dave Ayers
quote:
Report > Output > Check "Show Row Totals" checkbox



And that's intuitive ??


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
November 16, 2009, 05:19 PM
Francis Mariani
Never said it was Smiler If you've read my rants, you would know I am not an advocate for GUI development. My suggestion might be one of a couple of solutions - I just poked around and found the Show Row Totals checkbox - not intuitive at all.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 17, 2009, 07:10 PM
bcook278
quote:
Report > Output > Check "Show Row Totals" checkbox


I tried this and still have the same result from the GUI. It places the compute under the SUM as shown below (slightly different example using the CAR file:

TABLE FILE CAR
SUM
COMPUTE DIFF/D12 = C1 - C2;
'CAR.BODY.SALES'
BY 'CAR.BODY.BODYTYPE'
ACROSS 'CAR.ORIGIN.COUNTRY'
HEADING
""
FOOTING
""
WHERE CAR.ORIGIN.COUNTRY EQ 'ENGLAND' OR 'JAPAN';

########

If I try to change the COMPUTE from a SUM to an ACROSS I get an error and occasionally this even blows up DEV Studio.

I can manually move this down under the ACROSS and it gives me the result I want. If I then go back into the GUI and edit the compute the compute popup displays with the title . No reference to an ACROSS COMPUTE anywhere in the GUI.

Think I am starting to know come over to your way of thinking Francis and may just build these out all in FOCUS language......at least until the GUI is either better documented or more intuitive Smiler

Thanks for the help,
Bob


WebFOCUS 7.6.8
WebFOCUS Client and Server running on RedHat Linux, Developer Studio on Windows XP
All output formats
Francis Mariani
Bob,

Here's an example where the GUI cannot generate an ACROSS Total. This option was added to the language in WebFOCUS v7.6 but it isn't in the GUI yet, they are now at v7.6.10.

This code seems to be OK for the v7.6.5 GUI:

-* File ggsales2.fex
DEFINE FILE GGSALES
SYEAR/YY=DATE;
END
TABLE FILE GGSALES
SUM
     'GGSALES.SALES01.DOLLARS'
BY 'GGSALES.SALES01.STCD'
ACROSS 'GGSALES.SALES01.SYEAR' AS ''
     COMPUTE
          VAR/D12 = C2 - C1;
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
     COLOR='BLACK',
     STYLE=NORMAL,
$
TYPE=TITLE,
     STYLE=BOLD,
$
TYPE=ACROSSVALUE,
     ACROSS=1,
     STYLE=BOLD,
$
TYPE=ACROSSTITLE,
     ACROSS=1,
     STYLE=BOLD,
$
ENDSTYLE
END

(I can't figure out how to add a Title for the computed field VAR.)


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server