[CLOSED] Multiple totals after a date range selection.
I'm sure this is easy for someone, but I'm having trouble and could use a simple chunch of sample code.
I am passing a table, selecting a date range using filters, and want to tally various quantities for a one line report. I seem to recall I can create a table first, then run queries against that table all within one FEX. Does this sound doable?This message has been edited. Last edited by: Kerry,
WebFOCUS Version: 7703 Windows, all output
May 23, 2012, 09:11 AM
Don Garland
ewinery,
This request is a bit vague and I can't remember if there are two or four chunches in one chuck. Just kidding. Here is a sample report that I think might be what your talking about. If you're using DevStudio, you can drop this in the console and run it. It's a simple report based on the GGSALES datasource that ships with WebFOCUS and it uses a date range filter.
Hope this helps.
TABLE FILE GGSALES
SUM
'GGSALES.SALES01.BUDDOLLARS'
'GGSALES.SALES01.DOLLARS'
'GGSALES.SALES01.BUDUNITS'
BY 'GGSALES.SALES01.REGION'
BY 'GGSALES.SALES01.ST'
BY 'GGSALES.SALES01.CITY'
BY 'GGSALES.SALES01.DATE'
HEADING
""
FOOTING
""
WHERE ( GGSALES.SALES01.DATE GE 19960101 ) AND ( GGSALES.SALES01.DATE LE 19960131 );
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
$
TYPE=TITLE,
STYLE=BOLD,
$
TYPE=TABHEADING,
SIZE=12,
STYLE=BOLD,
$
TYPE=TABFOOTING,
SIZE=12,
STYLE=BOLD,
$
TYPE=HEADING,
SIZE=12,
STYLE=BOLD,
$
TYPE=FOOTING,
SIZE=12,
STYLE=BOLD,
$
TYPE=SUBHEAD,
SIZE=10,
STYLE=BOLD,
$
TYPE=SUBFOOT,
SIZE=10,
STYLE=BOLD,
$
TYPE=SUBTOTAL,
BACKCOLOR=RGB(210 210 210),
$
TYPE=ACROSSVALUE,
SIZE=9,
$
TYPE=ACROSSTITLE,
STYLE=BOLD,
$
TYPE=GRANDTOTAL,
BACKCOLOR=RGB(210 210 210),
STYLE=BOLD,
$
ENDSTYLE
END
This is terribly doable. As Don says, the request is vague, but you sort of imply that you want to assemble some data and subsequently create a one-line summary. Don's does that for already existing data.
You may have to create a HOLD file ahead of time by running one or more TABLE FILE (or MATCH FILE) requests (to assemble the data) and then run a report right after that for your one-line summary.
Doing this all within one FEX is perfectly normal procedure. You could separate out each stage as a separate FEX and then have a final FEX with a bunch of -INCLUDE statements but I think that's overkill here.
As just about every post on here indicates, the GUI does not replace hand-coding - specially when there are perhaps multiple steps involved.