Copyright 2007, Information Builders. Slide 1
Hidden Gems
Walter F. BloodTechnical Director
Information Builders, Inc
Hidden GemsWhere We Will Look
… in SettingsCoping with PDF and unixSimplifying and controlling echoDBA and connections
… in ConnectionsCombining tables based on rangesConnecting tables with nothing in common
… in ExpressionsWorking with more than one record instance at a timeWriting to multiple files simultaneouslyCreating your own business related functions
… in SortingAutomatic summary column creation
Copyright 2007, Information Builders. Slide 3
Hidden Gems…In Settings
Coping with PDF and unix
Simplifying ECHO
DBA and connections
Copyright 2007, Information Builders. Slide 4
Hidden Gems…In Settings
PDFLINETERMDEFECHODBASOURCE
Hidden GemsSET Parameters
Switches that affect behavior – scope variesYou can set at multiple levels
EDASPROF Group/User Profile Focexec Request
Look at the difference in behavior to see when to apply them
CorruptPDF
Hidden GemsSET Parameters – PDFLINETERM
Truly hidden – not available currently in SET tool To eliminate corrupt PDF files that pass through UNIX
systems in distribution. Adds additional space to account for the difference in
new line indicator.
SET PDFLINETERM=OFF | ON
PDFUNIX
&ECHO allows tracing of WebFOCUS execution -SET &ECHO – local variable requires setting in each script
Provides setting for default value of &ECHODefault value is used in all INCLUDEd and EXECuted fexes
unless –SET issuedTrace appears in View Source window
Hidden GemsSET Parameters – DEFECHO
SET DEFECHO=OFF | ON | ALL | NONE
Hidden GemsSET Parameters – DEFECHO
SET DEFECHO=OFF | ON | ALL | NONE
One setting controls all –NONE – Prevents unauthorized use of ECHO. Cannot be reset OFF – No tracing of WebFOCUS stackON – Tracing of WebFOCUS stack only ALL – Tracing of WebFOCUS stack and Dialogue Manager (including &variable substitution)
Controls which DBA is applied to in JOIN structure
Default value – HOST - Applies DBA from HOST file onlyValue – ALL – Applies DBA from both files if presentAccess control – FILE, SEGMENT, FIELD, VALUEDBA converted to selection criteria and optimized
Hidden GemsSET Parameters – DBASOURCE
XREFHOST JOIN
DBA1 DBA2
Copyright 2007, Information Builders. Slide 10
Hidden Gems…In Connections
Connect files based on a range of values
Connect files with NO apparent connection
Copyright 2007, Information Builders. Slide 11
Hidden GemsConnection
• Standard JOIN based upon equality selection
EMPLOYEE IDLAST NAMEFIRST NAMEHIRE DATECURRENT SALARY…
Employee
TAX YEARTAX RATEMINIMUM SALARYMAXIMUM SALARY
Tax Rate
JOIN field IN file TO ALL field IN file AS name
Copyright 2007, Information Builders. Slide 12
Hidden GemsConnect Based on Equality
Copyright 2007, Information Builders. Slide 13
Hidden GemsConnect Based on Equality
Copyright 2007, Information Builders. Slide 14
Hidden GemsConnect Based on Equality
Copyright 2007, Information Builders. Slide 15
Hidden GemsConnect Based on Range of Values
•Connection can also be based upon range - • LE, LT, GE, GT, NE or FROM /TO
EMPLOYEE IDLAST NAMEFIRST NAMEHIRE DATECURRENT SALARY…
EMPLOYEE
TAX YEARTAX RATEMINIMUM SALARYMAXIMUM SALARY
TAX RATE
JOIN FILE file AT field TO ALL FILE file AT field AS nameWHERE condition
Copyright 2007, Information Builders. Slide 16
Hidden GemsConnect Based on Range
Copyright 2007, Information Builders. Slide 17
Hidden GemsInsurance Rates – Listing
Problem: Selecting the correct insurance rate based upon age from a table with ranges---
Minimum MaximumAge Age Insurance Rate21 27 $ 8.0028 34 $ 9.00
35 40 $10.0041 44 $11.00
Copyright 2007, Information Builders. Slide 18
Hidden GemsIn Connections - Insurance Rates
JOIN FILE EMPDATA1 AT BIRTHDATE TO ALL FILE RATES AT AGE AS J1 WHERE EMPDATA1.BAGE GE RATES.AGE; WHERE EMPDATA1.BAGE LE RATES.EAGE; END TABLE FILE EMPDATA1HEADING"To: <FIRSTNAME <LASTNAME " "</1 Thank you for choosing our company for your <0X insurance needs." "Thank you for choosing our company for your insurance needs.”"Since your birth date is <BIRTHDTATE ,your current rate is<0X <RATE_PER_THOUSAND per""unit of coverage. This is your rate through age <EAGE . “ON TABLE SET PAGE OFF BY PIN NOPRINT PAGE-BREAKEND
JOIN FILE EMPDATA1 AT BIRTHDATE TO ALL FILE RATES AT AGE AS J1 WHERE EMPDATA1.BAGE GE RATES.AGE; WHERE EMPDATA1.BAGE LE RATES.EAGE; END TABLE FILE EMPDATA1HEADING"To: <FIRSTNAME <LASTNAME " "</1 Thank you for choosing our company for your <0X insurance needs." "Thank you for choosing our company for your insurance needs.”"Since your birth date is <BIRTHDTATE ,your current rate is<0X <RATE_PER_THOUSAND per""unit of coverage. This is your rate through age <EAGE . “ON TABLE SET PAGE OFF BY PIN NOPRINT PAGE-BREAKEND
Greater than Minimum Age
Less than Maximum Age
Copyright 2007, Information Builders. Slide 19
Hidden GemsIn Connections
Connect files that have NO apparent connection
Employee Salary History
New CarFinance
PackagesJOIN?JOIN?
Copyright 2007, Information Builders. Slide 20
Hidden GemsIn Connections
Copyright 2007, Information Builders. Slide 21
Hidden GemsIn Connections
Employee Salary History
New CarFinance
Packages
JOIN?
Copyright 2007, Information Builders. Slide 22
Hidden GemsIn Connections
Conditional Join Considerations:
Cartesian product
WHERE condition controls selection
Complex WHEREs supported
Multiple WHERE conditions
WHERE must contain fields from both files
Remove WHERE – true cartesian product
Range-based JOIN in the tool
Join with no common fields in text mode
Copyright 2007, Information Builders. Slide 23
Hidden GemsIn Expressions
Writing to multiple files simultaneously
Working with more than one record instance at a time
Creating your own business related
functions
Copyright 2007, Information Builders. Slide 24
Hidden GemsIn Expressions
Working with more than one record instance at a time
Available in COMPUTE, DEFINE, WHERE
References the field value in the previous record
Works with real and virtual fields
THE FUNCTION
Copyright 2007, Information Builders. Slide 25
Hidden GemsIn Expressions
Copyright 2007, Information Builders. Slide 26
Hidden GemsIn Expressions
1. Select LAST2. Get Fieldname
Copyright 2007, Information Builders. Slide 27
Hidden GemsIn Expressions
In DEFINE
Copyright 2007, Information Builders. Slide 28
Hidden GemsIn Expressions
In DEFINE
Copyright 2007, Information Builders. Slide 29
Hidden GemsIn Expressions
In COMPUTE
Copyright 2007, Information Builders. Slide 30
Hidden GemsIn Expressions
Same as DEFINE
Operates on matrixProcesses same or fewer records than DEFINE
In COMPUTE
Copyright 2007, Information Builders. Slide 31
Hidden GemsIn Expressions
In WHERE
CAR.ORIGIN.COUNTRY NE LAST CAR.ORIGIN.COUNTRY
Copyright 2007, Information Builders. Slide 32
Hidden GemsIn Expressions
In WHERE
Failed?Multiple Country’sWhy?
Order is importantDEFINE order is the order of READ
Copyright 2007, Information Builders. Slide 33
Hidden GemsIn Expressions
In WHERE
Data in matrix sortedWHERE TOTAL on COMPUTEResults?
Copyright 2007, Information Builders. Slide 34
Hidden GemsIn Expressions
In WHERE
Ta Da!
Copyright 2007, Information Builders. Slide 35
Hidden GemsIn Expressions
In WHERE
Using LAST: Detecting value changes of data in ordered sets
Nested IF…THEN…ELSECreate new sort-able select-able groups
Creating identifiers based on ordered fieldsDEFINE - BY / WHERECOMPUTE - BY TOTAL / WHERE TOTAL
Creating running values on any fieldsTotals, Averages, Margins, Any calculation
Holding preceding data values for calculation
In DEFINE In COMPUTE
Copyright 2007, Information Builders. Slide 36
Hidden GemsIn Expressions
In WHERE
LAST Considerations:
The order the data is processed is critical
You may need to presort data to a hold file
Not optimizable to relational databases
DEFINES work with WHERE
COMPUTES work with WHERE TOTAL
In DEFINE In COMPUTE
Hidden GemsIn Expressions
Writing to multiple files simultaneously
To create a log of specific data values readWhich customers placed orders?
To create of record of calculated valuesWill I go out of stock on any these orders?
To create additional outputWhat page number will this item be on?
PUTDDREC
Hidden GemsIn Expressions
PUTDDREC syntax:
PUTDDREC(ddname, dd_len, record_string, record_len, outfield)
ddname - ddname assigned by filedef to output filedd_len - length of the ddnamerecord_string - string of characters to write to file or field
containing that stringrecord_len - length of the string to be includedoutfield - return code
Output file must be filedef’dDEFINE/COMPUTE field format always I1Handles open, write and close
Hidden GemsIn Expressions
FILEDEF PUTDD1 DISK putdd1.datTABLE FILE EMPLOYEEPRINT EMP_ID CURR_JOBCODE AS 'JOB' CURR_SALCOMPUTE SALA/A12 = EDIT(CURR_SAL); NOPRINTCOMPUTE EMP1/A50= LAST_NAME|FIRST_NAME|EMP_ID|CURR_JOBCODE|SALA;NOPRINTCOMPUTE OUT1/I1 = PUTDDREC('PUTDD1',6, EMP1, 50, OUT1);BY LAST_NAME BY FIRST_NAMEEND
PUTDDREC in Action
Hidden GemsIn Expressions
LAST_NAME FIRST_NAME EMP_ID JOB CURR_SAL OUT1--------- ---------- --------- --- -------- ----BANNING JOHN 119329144 A17 $29,700.00 0BLACKWOOD ROSEMARIE 326179357 B04 $21,780.00 0CROSS BARBARA 818692173 A17 $27,062.00 0GREENSPAN MARY 543729165 A07 $9,000.00 0IRVING JOAN 123764317 A15 $26,862.00 0JONES DIANE 117593129 B03 $18,480.00 0MCCOY JOHN 219984371 B02 $18,480.00 0MCKNIGHT ROGER 451123478 B02 $16,100.00 0ROMANS ANTHONY 126724188 B04 $21,120.00 0SMITH MARY 112847612 B14 $13,200.00 0 RICHARD 119265415 A01 $9,500.00 0STEVENS ALFRED 071382660 A07 $11,000.00 0
Report Created
Hidden GemsIn Expressions
BANNING JOHN 119329144A17000000029700BLACKWOOD ROSEMARIE 326179357B04000000021780CROSS BARBARA 818692173A17000000027062GREENSPAN MARY 543729165A07000000009000IRVING JOAN 123764317A15000000026862JONES DIANE 117593129B03000000018480MCCOY JOHN 219984371B02000000018480MCKNIGHT ROGER 451123478B02000000016100ROMANS ANTHONY 126724188B04000000021120SMITH MARY 112847612B14000000013200SMITH RICHARD 119265415A01000000009500STEVENS ALFRED 071382660A07000000011000
Sequential File Created
Hidden GemsIn Expressions
PUTDDREC Considerations:
Create fixed data file to fit a specific Master file
Create comma-delimited data file for loading
System and User &variables are available
&MDYY, &FOCCPU, &FOCUSER, etc
Write control at any point or multiple points
Write to multiple PUTDDREC files in a request
Hidden GemsIn Expressions
Creating an Index in PDF with PUTDDREC 1. Create a filedef for the index output file.2. Create request that you want to index.
1. Including HOLD to PDF2. Including all styling required
3. Add NOPRINTED COMPUTE that – 1. Tests for a change of sort break2. Uses PUTDDREC to put values in file
&TABPAGENO Sort Break Value
4. Create pdf index request using index output5. Run original request as compound pdf, followed by
index request , creating single pdf.
YHidden GemsIn Expressions
StandardizationCorporate business logicFOCUS/WebFOCUS coding standards
Simplification Complicated groups of expressionsRepeated groups of expressions
CreationNew subroutines currently unavailable Customization of existing functions
Based on the FOCUS/WebFOCUS language
Creating your own business related functions
Hidden GemsIn Expressions
The Syntax of FUNCTIONS - 1
DEFINE FUNCTION name (arg1/format,…argn/formatn)[tempvariablea/formata = expressiona;]..[tempvariablen/formatn = expressionn;]name/format = [result_expression];END
DEFINE FUNCTION name (arg1/format,…argn/formatn)[tempvariablea/formata = expressiona;]..[tempvariablen/formatn = expressionn;]name/format = [result_expression];END
Name of function = Last field calculated in function.Returns value to calling procedure.
Name of function = Last field calculated in function.Returns value to calling procedure.
Arguments and formats that are used when the function is called.
Fields actually used in call must match the type indicated – alpha or numeric.
Alpha Too short – space padded Too long – truncated
Arguments and formats that are used when the function is called.
Fields actually used in call must match the type indicated – alpha or numeric.
Alpha Too short – space padded Too long – truncated
Hidden GemsIn Expressions
The Syntax of FUNCTIONS - 2
DEFINE FUNCTION name (argument1/format,…argumentn/formatn)[tempvariablea/formata = expressiona;]..[tempvariablen/formatn = expressionn;]name/format = [result_expression];END
DEFINE FUNCTION name (argument1/format,…argumentn/formatn)[tempvariablea/formata = expressiona;]..[tempvariablen/formatn = expressionn;]name/format = [result_expression];END
Intermediate fields use in calculation of final result. Unlimited numberUse arguments, constants and other temporary fields declared in the function. Use all operators and most functions
Intermediate fields use in calculation of final result. Unlimited numberUse arguments, constants and other temporary fields declared in the function. Use all operators and most functions
Hidden GemsIn Expressions
The Syntax of FUNCTIONS - 3
DEFINE FUNCTION name (argument1/format,…argumentn/formatn)[tempvariablea/formata = expressiona;]..[tempvariablen/formatn = expressionn;]name/format = [result_expression];END
DEFINE FUNCTION name (argument1/format,…argumentn/formatn)[tempvariablea/formata = expressiona;]..[tempvariablen/formatn = expressionn;]name/format = [result_expression];END
Final field defines the value returned.Name must match name of function. Format indicates the format returned.
Final field defines the value returned.Name must match name of function. Format indicates the format returned.
Hidden GemsIn Expressions
MARGIN Function
DEFINE FUNCTION MARGIN CLEAR
DEFINE FUNCTION MARGIN (RC/D7, DC/D7)NETPROFIT/D7=RC-DC;MARGIN/D5.2=(NETPROFIT*100)/DC;END
TABLE FILE CARPRINT COUNTRY CAR MODEL SALESAND COMPUTE MARGIN/D5.2 = MARGIN(RETAIL_COST,DEALER_COST);WHERE MARGIN(RETAIL_COST, DEALER_COST) GT 20END
DEFINE FUNCTION MARGIN CLEAR
DEFINE FUNCTION MARGIN (RC/D7, DC/D7)NETPROFIT/D7=RC-DC;MARGIN/D5.2=(NETPROFIT*100)/DC;END
TABLE FILE CARPRINT COUNTRY CAR MODEL SALESAND COMPUTE MARGIN/D5.2 = MARGIN(RETAIL_COST,DEALER_COST);WHERE MARGIN(RETAIL_COST, DEALER_COST) GT 20END
YHidden GemsIn Expressions
Easily accessed throughout WebFOCUS
Connected to Master File?
DF. Operator Dynamic load and run of functionFunction location indicated
Additional characteristics availableDescription
Functions in Master Files?
Hidden GemsIn Expressions
Hidden GemsIn Expressions
Hidden GemsIn Expressions
Hidden GemsIn Expressions
Hidden GemsIn Expressions
Hidden GemsIn Expressions
DEFINE FUNCTION DMDATFMTDESCRIPTION 'Convert date to 2008-JUL-04 format‘(INDATE/YYMD) CONVDATE/A8YYMD=DATECVT(INDATE, 'YYMD', 'A8YYMD'); DMDATFMT/A11=CHGDAT( 'YYMD', 'YYMTD', CONVDATE, 'A11' ); END
DEFINE FUNCTION DMPROPERDESCRIPTION 'Convert name to proper case and last, first format‘(LASTNAME/A17, FIRSTNAME/A14) DMPROPER/A34V=LCWORD(17, LASTNAME, 'A17') || (', ' | LCWORD(14, FIRSTNAME, 'A14')); END
DEFINE FUNCTION DMDATFMTDESCRIPTION 'Convert date to 2008-JUL-04 format‘(INDATE/YYMD) CONVDATE/A8YYMD=DATECVT(INDATE, 'YYMD', 'A8YYMD'); DMDATFMT/A11=CHGDAT( 'YYMD', 'YYMTD', CONVDATE, 'A11' ); END
DEFINE FUNCTION DMPROPERDESCRIPTION 'Convert name to proper case and last, first format‘(LASTNAME/A17, FIRSTNAME/A14) DMPROPER/A34V=LCWORD(17, LASTNAME, 'A17') || (', ' | LCWORD(14, FIRSTNAME, 'A14')); END
Contents of dmfns.fex
Hidden GemsIn Expressions
Hidden GemsIn Expressions
Hidden GemsIn Expressions
Hidden GemsIn Expressions
AGENT1 AGENT_TALK AGENT_TALK1 TTIME TTIME1ALLEN 200 300 00:03:20 00:05:00BILL 300 400 00:05:00 00:06:40CARL 620 520 00:10:20 00:08:40DAN 400 901 00:06:40 00:15:01
---------------------------------------------------------TOTAL 1520 2121 00:25:20 00:35:21
We Need A Report That Reads Times In Seconds,
PROBLEM:
Adds Them And Converts To Hours : Minutes : Seconds
DEFINE FUNCTION HRMISC (SEC/I10)-* CALCULATE HOURSHR/I2 = SEC/3600;HR_R/I2 = SEC -(HR* 3600) ;-* CALCULATE MINMI/I2 = (HR_R / 60);-* CALCULATE SECONDSSC_D/I2 = SEC -((MI * 60) + HR);HRMISC/A8 = EDIT(HR) || ':' || EDIT(MI) || ':' || EDIT(SC_D) ;END
DEFINE FUNCTION HRMISC (SEC/I10)-* CALCULATE HOURSHR/I2 = SEC/3600;HR_R/I2 = SEC -(HR* 3600) ;-* CALCULATE MINMI/I2 = (HR_R / 60);-* CALCULATE SECONDSSC_D/I2 = SEC -((MI * 60) + HR);HRMISC/A8 = EDIT(HR) || ':' || EDIT(MI) || ':' || EDIT(SC_D) ;END
Hidden GemsIn Expressions
SOLUTION:
Copyright 2007, Information Builders. Slide 61
Hidden GemsIn Sorting
Automatic summary column creation
Hidden GemsIn Sorting
TABLE FILE GGSALESSUM UNITS AS 'UNITS' DOLLARS AS 'DOLLARS' BY PRODUCT BY REGIONBY DATEWHERE DATE FROM 19970801 TO 19971231;WHERE PRODUCT EQ 'Capuccino' OR 'Espresso';ON DATE SUB-TOTAL AS 'REGION TOTAL'ON TABLE SUB-TOTALEND
TABLE FILE GGSALESSUM UNITS AS 'UNITS' DOLLARS AS 'DOLLARS' BY PRODUCT BY REGIONBY DATEWHERE DATE FROM 19970801 TO 19971231;WHERE PRODUCT EQ 'Capuccino' OR 'Espresso';ON DATE SUB-TOTAL AS 'REGION TOTAL'ON TABLE SUB-TOTALEND
You know the effect of SUB-TOTAL on a BY field…
Product Region Date UNITS DOLLARS------- ------ ---- ----- -------Capuccino Northeast 1997/08/01 1473 19486
REGION TOTAL 1997/08/01 1473 19486.. REGION TOTAL 1997/12/01 1188 13668*TOTAL REGION Northeast 11551 144742.
Product Region Date UNITS DOLLARS------- ------ ---- ----- -------Capuccino Northeast 1997/08/01 1473 19486
REGION TOTAL 1997/08/01 1473 19486.. REGION TOTAL 1997/12/01 1188 13668*TOTAL REGION Northeast 11551 144742.
Hidden GemsIn Sorting
TABLE FILE GGSALESSUM UNITS AS 'UNITS' OVER DOLLARS AS 'DOLLARS' OVERBY PRODUCT ACROSS REGION ACROSS DATEON DATE SUB-TOTAL AS 'REGION'ON TABLE SUB-TOTALWHERE DATE FROM 19970801 TO 19971231;WHERE PRODUCT EQ 'Capuccino' OR 'Espresso';END
TABLE FILE GGSALESSUM UNITS AS 'UNITS' OVER DOLLARS AS 'DOLLARS' OVERBY PRODUCT ACROSS REGION ACROSS DATEON DATE SUB-TOTAL AS 'REGION'ON TABLE SUB-TOTALWHERE DATE FROM 19970801 TO 19971231;WHERE PRODUCT EQ 'Capuccino' OR 'Espresso';END
Now see the effect of SUB-TOTAL on an ACROSS field…
Region Midwest West TOTAL MNTHProduct NOV DEC REGION NOV DEC REGION ------- --- --- ------ --- --- ------ -----Capuccino UNITS . . . 2535 4051 6586 6586 DOLLARS . . . 31153 57421 88574 88574Espresso UNITS 2186 1752 3938 3088 3732 6820 10758 DOLLARS 27526 22281 49807 36123 51400 87523 137330 TOTAL UNITS 2186 1752 3938 5623 7783 13406 17344 DOLLARS 27526 22281 49807 67276 108821 176097 225904
Region Midwest West TOTAL MNTHProduct NOV DEC REGION NOV DEC REGION ------- --- --- ------ --- --- ------ -----Capuccino UNITS . . . 2535 4051 6586 6586 DOLLARS . . . 31153 57421 88574 88574Espresso UNITS 2186 1752 3938 3088 3732 6820 10758 DOLLARS 27526 22281 49807 36123 51400 87523 137330 TOTAL UNITS 2186 1752 3938 5623 7783 13406 17344 DOLLARS 27526 22281 49807 67276 108821 176097 225904
Hidden GemsIn Sorting
TABLE FILE GGSALESSUM UNITS AS 'UNITS' DOLLARS AS 'DOLLARS' COMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT PRICE'BY PRODUCT BY REGIONBY DATEWHERE DATE FROM 19970801 TO 19971231;WHERE PRODUCT EQ 'Capuccino' OR 'Espresso';ON DATE SUMMARIZE AS 'REGION TOTAL'ON TABLE SUMMARIZEEND
TABLE FILE GGSALESSUM UNITS AS 'UNITS' DOLLARS AS 'DOLLARS' COMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT PRICE'BY PRODUCT BY REGIONBY DATEWHERE DATE FROM 19970801 TO 19971231;WHERE PRODUCT EQ 'Capuccino' OR 'Espresso';ON DATE SUMMARIZE AS 'REGION TOTAL'ON TABLE SUMMARIZEEND
You know the effect of SUMMARIZE on a BY field…
Product Region Date UNITS DOLLARS UNIT PRICE------- ------ ---- ----- ------- ----------Capuccino Northeast 1997/08/01 1473 19486 13
REGION TOTAL 1997/08/01 1473 19486 13... REGION TOTAL 1997/12/01 1188 13668 11*TOTAL REGION Northeast 11551 144742 12
Product Region Date UNITS DOLLARS UNIT PRICE------- ------ ---- ----- ------- ----------Capuccino Northeast 1997/08/01 1473 19486 13
REGION TOTAL 1997/08/01 1473 19486 13... REGION TOTAL 1997/12/01 1188 13668 11*TOTAL REGION Northeast 11551 144742 12
Hidden GemsIn Sorting
TABLE FILE GGSALESSUM UNITS AS 'UNITS' OVER DOLLARS AS 'DOLLARS' OVERCOMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT PRICE'BY PRODUCT ACROSS REGION ACROSS DATEON DATE SUMMARIZE AS 'REGION'ON TABLE SUMMARIZEWHERE DATE FROM 19970801 TO 19971231;WHERE PRODUCT EQ 'Capuccino' OR 'Espresso';END
TABLE FILE GGSALESSUM UNITS AS 'UNITS' OVER DOLLARS AS 'DOLLARS' OVERCOMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT PRICE'BY PRODUCT ACROSS REGION ACROSS DATEON DATE SUMMARIZE AS 'REGION'ON TABLE SUMMARIZEWHERE DATE FROM 19970801 TO 19971231;WHERE PRODUCT EQ 'Capuccino' OR 'Espresso';END
Now see the effect of SUMMARIZE on an ACROSS field…
Region Midwest West TOTAL MNTHProduct NOV DEC REGION NOV DEC REGION ------- --- --- ------ --- --- ------ -----Capuccino UNITS . . . 2535 4051 6586 6586 DOLLARS . . . 31153 57421 88574 88574 UNIT PRICE . . . 12 14 13 13Espresso UNITS 2186 1752 3938 3088 3732 6820 10758 DOLLARS 27526 22281 49807 36123 51400 87523 137330 UNIT PRICE 12 12 12 11 13 12 12 TOTAL UNITS 2186 1752 3938 5623 7783 13406 17344 DOLLARS 27526 22281 49807 67276 108821 176097 225904 UNIT PRICE 12 12 12 11 13 13 13
Region Midwest West TOTAL MNTHProduct NOV DEC REGION NOV DEC REGION ------- --- --- ------ --- --- ------ -----Capuccino UNITS . . . 2535 4051 6586 6586 DOLLARS . . . 31153 57421 88574 88574 UNIT PRICE . . . 12 14 13 13Espresso UNITS 2186 1752 3938 3088 3732 6820 10758 DOLLARS 27526 22281 49807 36123 51400 87523 137330 UNIT PRICE 12 12 12 11 13 12 12 TOTAL UNITS 2186 1752 3938 5623 7783 13406 17344 DOLLARS 27526 22281 49807 67276 108821 176097 225904 UNIT PRICE 12 12 12 11 13 13 13
SUB-TOTALSUBTOTALSUMMARIZERECOMPUTE
Hidden GemsIn Sorting
TABLE FILE GGSALESSUM UNITS AS 'UNITS' OVER DOLLARS AS 'DOLLARS' OVERCOMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT PRICE'BY PRODUCT ACROSS REGION ACROSS DATEON DATE SUMMARIZE AS 'REGION'ON TABLE SUMMARIZEWHERE DATE FROM 19970801 TO 19971231;WHERE PRODUCT EQ 'Capuccino' OR 'Espresso';END
TABLE FILE GGSALESSUM UNITS AS 'UNITS' OVER DOLLARS AS 'DOLLARS' OVERCOMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT PRICE'BY PRODUCT ACROSS REGION ACROSS DATEON DATE SUMMARIZE AS 'REGION'ON TABLE SUMMARIZEWHERE DATE FROM 19970801 TO 19971231;WHERE PRODUCT EQ 'Capuccino' OR 'Espresso';END
Currently requires text mode
Triggered with ON <field> SUMMARIZE AS ‘title’
Style as DATA, OBJECT, or COLUMN
Hidden GemsWhere We Looked
Coping with PDF and unix
Simplifying and controlling echo
DBA and connections
Combining tables based on ranges
Connecting tables with
nothing in common
Working with more than one
record instance at a time
Writing to multiple files simultaneously
Creating your own business related functions
Automatic summary column creation
Questions?Questions?