Copyright 2007, Information Builders. Slide 1 Hidden Gems Walter F. Blood Technical Director Information Builders, Inc.

Slides:



Advertisements
Similar presentations
Debugging ACL Scripts.
Advertisements

Copyright 2007, Information Builders. Slide 1 Dates and Functions Noreen Redden Information Builders, Inc.
BUSINESS DRIVEN TECHNOLOGY Decision Analysis Tools in Excel
McGraw-Hill/Irwin ©2008 The McGraw-Hill Companies, All Rights Reserved TECHNOLOGY PLUG-IN T4 PROBLEM SOLVING USING EXCEL Goal Seek, Solver & Pivot Tables.
McGyver for Dynamic Subtotals/Subfoots Presented by David Smith of Brinker International.
Chapter 3: Engage! Android User Input, Variables, and Operations
Copyright 2007, Information Builders. Slide 1 Non-Relational Efficiencies Walter F. Blood Technical Director Information Builders, Inc.
1 Copyright 2007, Information Builders. Slide 1 Nat Poe WebFOCUS Debugging Techniques.
Copyright 2007, Information Builders. Slide 1 Tips and Techniques From the FOCWIZARDs Art Greenhaus & Noreen Redden FOCWIZARDS Tech Summit, 2008.
Copyright 2007, Information Builders. Slide 1 Restricting Access To a File Walter Brengel June, 2008.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Guide To UNIX Using Linux Third Edition
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Introduction to Query Part 2. Query Topics Joining Files Defining Result Fields Complex Record Selection Formatting Output Creating Reports Using Multiple.
Welcome to SAS…Session..!. What is SAS..! A Complete programming language with report formatting with statistical and mathematical capabilities.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Exploring Formulas.
Chapter 06: Lecture Notes (CSIT 104) 1 Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Copyright © 2008 Prentice-Hall. All rights reserved.
“You Asked For It, You Got It!” Best New [Backend ] Features of WebFOCUS Renee Teatro Information Builders December 2011.
1 JOIN: Rules, Roles, and Conventions Floria Foote June 2008.
Variables and Constants
Copyright 2007, Information Builders. Slide 1 JOIN, MATCH and MORE– Making the Connections Walter F. Blood Technical Director, FOCUS Division May, 2011.
Copyright 2007, Information Builders. Slide 1 Tips and Techniques for FOCUS 76 Did You Know? Walter F. Blood Information Builders, Inc.
Lesson 1: Introduction to ABAP OBJECTS Todd A. Boyle, Ph.D. St. Francis Xavier University.
REVIEW 2 Exam History of Computers 1. CPU stands for _______________________. a. Counter productive units b. Central processing unit c. Copper.
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 3 Analyzing Data and Creating Reports.
1 Agenda – 03/25/2014 Login to SQL Server 2012 Management Studio. Answer questions about HW#7 – display answers. Exam is 4/1/2014. It will be in the lab.
Input, Output, and Processing
1 System Administration Introduction to Scripting, Perl Session 3 – Sat 10 Nov 2007 References:  chapter 1, The Unix Programming Environment, Kernighan.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Copyright © 2008 Pearson Prentice Hall. All rights reserved Chapter 6 Data Tables and Amortization Tables Exploring Microsoft Office Excel 2007.
 Agenda 2/20/13 o Review quiz, answer questions o Review database design exercises from 2/13 o Create relationships through “Lookup tables” o Discuss.
Copyright 2007, Information Builders. Slide 1 JOIN, MATCH and MORE– Making the Connections Walter F. Blood Technical Director, FOCUS Division June, 2009.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
FILTERS and FUNCTIONS: Hidden Gems Walter F. Blood Technical Director, FOCUS Division June, 2008.
Database Applications – Microsoft Access Lesson 4 Working with Queries 36 Slides in Presentation.
Chapter 3: Assignment, Formatting, and Interactive Input.
Microsoft® Excel Key and format dates and times. 1 Use Date & Time functions. 2 Use date and time arithmetic. 3 Use the IF function. 4 Create.
Queries SELECT [DISTINCT] FROM ( { }| ),... [WHERE ] [GROUP BY [HAVING ]] [ORDER BY [ ],...]
1 Guide to Oracle10G CHAPTER 7: Creating Database Reports 7.
13-1 Sequential File Processing Chapter Chapter Contents Overview of Sequential File Processing Sequential File Updating - Creating a New Master.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Access Queries Agenda 6/16/14 Review Access Project Part 1, answer questions Discuss queries: Turning data stored in a database into information for decision.
Agenda Positional Parameters / Continued... Command Substitution Bourne Shell / Bash Shell / Korn Shell Mathematical Expressions Bourne Shell / Bash Shell.
Microsoft Access Database Creation and Management.
Programming with Microsoft Visual Basic th Edition
JOIN Syntax and Techniques Noreen Redden Information Builders Copyright 2011, Information Builders. Slide 1.
A First Book of C++ Chapter 4 Selection. Objectives In this chapter, you will learn about: –Relational Expressions –The if-else Statement –Nested if Statements.
Copyright 2007, Information Builders. Slide 1 TABLE FILE: The Basics Noreen Redden FOCWizard June, 2008.
B Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Working with PDF and eText Templates.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
Pages Appendix B: Review of ExcelChapter 3 Market Trends & Analysis IBM 320 CAL POLY POMONA IBM320 Market Trends and Analysis Maha Ghosn.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
CHAPTER 7 LESSON B Creating Database Reports. Lesson B Objectives  Describe the components of a report  Modify report components  Modify the format.
The purpose of a CPU is to process data Custom written software is created for a user to meet exact purpose Off the shelf software is developed by a software.
Emdeon Office Batch Management Services This document provides detailed information on Batch Import Services and other Batch features.
Writing Basic SQL SELECT Statements
More Hidden Gems in the World of Reporting: Part 5
The Selection Structure
PHP Introduction.
Chapter 3 The DATA DIVISION.
Sirena Hardy HRMS Trainer
PHP.
Spreadsheets, Modelling & Databases
Presentation transcript:

Copyright 2007, Information Builders. Slide 1 Hidden Gems Walter F. Blood Technical Director Information Builders, Inc

Hidden Gems Where We Will Look  … in Settings  Coping with PDF and unix  Simplifying and controlling echo  DBA and connections  … in Connections  Combining tables based on ranges  Connecting tables with nothing in common  … in Expressions  Working with more than one record instance at a time  Writing to multiple files simultaneously  Creating your own business related functions  … in Sorting  Automatic 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  PDFLINETERM  DEFECHO  DBASOURCE

Hidden Gems SET Parameters  Switches that affect behavior – scope varies  You can set at multiple levels  EDASPROF  Group/User Profile  Focexec  Request  Look at the difference in behavior to see when to apply them

Corrupt PDF Hidden Gems SET 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 PDF UNIXUNIX

 &ECHO allows tracing of WebFOCUS execution  -SET &ECHO – local variable requires setting in each script  Provides setting for default value of &ECHO  Default value is used in all INCLUDEd and EXECuted fexes unless –SET issued  Trace appears in View Source window Hidden Gems SET Parameters – DEFECHO SET DEFECHO=OFF | ON | ALL | NONE

Hidden Gems SET 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 stack ON – 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 only  Value – ALL – Applies DBA from both files if present  Access control – FILE, SEGMENT, FIELD, VALUE  DBA converted to selection criteria and optimized Hidden Gems SET 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 Gems Connection Standard JOIN based upon equality selection EMPLOYEE ID LAST NAME FIRST NAME HIRE DATE CURRENT SALARY … Employee TAX YEAR TAX RATE MINIMUM SALARY MAXIMUM SALARY Tax Rate JOIN field IN file TO ALL field IN file AS name

Copyright 2007, Information Builders. Slide 12 Hidden Gems Connect Based on Equality

Copyright 2007, Information Builders. Slide 13 Hidden Gems Connect Based on Equality

Copyright 2007, Information Builders. Slide 14 Hidden Gems Connect Based on Equality

Copyright 2007, Information Builders. Slide 15 Hidden Gems Connect Based on Range of Values Connection can also be based upon range - LE, LT, GE, GT, NE or FROM /TO EMPLOYEE ID LAST NAME FIRST NAME HIRE DATE CURRENT SALARY … EMPLOYEE TAX YEAR TAX RATE MINIMUM SALARY MAXIMUM SALARY TAX RATE JOIN FILE file AT field TO ALL FILE file AT field AS name WHERE condition

Copyright 2007, Information Builders. Slide 16 Hidden Gems Connect Based on Range

Copyright 2007, Information Builders. Slide 17 Hidden Gems Insurance Rates – Listing MINIMUM AGE PIN BIRTHDATE BAGE RATE_PER_THOUSAND /24/ $ /17/ $ /07/ $ /20/ $ /06/ $ /10/ $ /08/ $ /08/ $ /24/ $ /17/ $ W 02/19/ $ /21/ $ /16/ $ /20/ $ /08/ $11 MINIMUM AGE PIN BIRTHDATE BAGE RATE_PER_THOUSAND /24/ $ /17/ $ /07/ $ /20/ $ /06/ $ /10/ $ /08/ $ /08/ $ /24/ $ /17/ $ W 02/19/ $ /21/ $ /16/ $ /20/ $ /08/ $11 Problem: Selecting the correct insurance rate based upon age from a table with ranges--- Minimum Maximum Age AgeInsurance Rate $ $ $ $11.00

Copyright 2007, Information Builders. Slide 18 Hidden Gems In 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 EMPDATA1 HEADING "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-BREAK END 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 EMPDATA1 HEADING "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-BREAK END Greater than Minimum Age Less than Maximum Age

Copyright 2007, Information Builders. Slide 19 Hidden Gems In Connections  Connect files that have NO apparent connection Employee Salary History New Car Finance Packages JOIN?

Copyright 2007, Information Builders. Slide 20 Hidden Gems In Connections

Copyright 2007, Information Builders. Slide 21 Hidden Gems In Connections Employee Salary History New Car Finance Packages JOIN?

Copyright 2007, Information Builders. Slide 22 Hidden Gems In 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 Gems In 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 Gems In 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 Gems In Expressions

Copyright 2007, Information Builders. Slide 26 Hidden Gems In Expressions 1. Select LAST 2. Get Fieldname

Copyright 2007, Information Builders. Slide 27 Hidden Gems In Expressions In DEFINE

Copyright 2007, Information Builders. Slide 28 Hidden Gems In Expressions In DEFINE

Copyright 2007, Information Builders. Slide 29 Hidden Gems In Expressions In COMPUTE

Copyright 2007, Information Builders. Slide 30 Hidden Gems In Expressions  Same as DEFINE  Operates on matrix  Processes same or fewer records than DEFINE In COMPUTE

Copyright 2007, Information Builders. Slide 31 Hidden Gems In Expressions In WHERE CAR.ORIGIN.COUNTRY NE LAST CAR.ORIGIN.COUNTRY

Copyright 2007, Information Builders. Slide 32 Hidden Gems In Expressions In WHERE  Failed?  Multiple Country’s  Why?  Order is important  DEFINE order is the order of READ

Copyright 2007, Information Builders. Slide 33 Hidden Gems In Expressions In WHERE  Data in matrix sorted  WHERE TOTAL on COMPUTE  Results?

Copyright 2007, Information Builders. Slide 34 Hidden Gems In Expressions In WHERE  Ta Da!

Copyright 2007, Information Builders. Slide 35 Hidden Gems In Expressions In WHERE Using LAST:  Detecting value changes of data in ordered sets  Nested IF…THEN…ELSE  Create new sort-able select-able groups  Creating identifiers based on ordered fields  DEFINE - BY / WHERE  COMPUTE - BY TOTAL / WHERE TOTAL  Creating running values on any fields  Totals, Averages, Margins, Any calculation  Holding preceding data values for calculation In DEFINE In COMPUTE

Copyright 2007, Information Builders. Slide 36 Hidden Gems In 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 Gems In Expressions  Writing to multiple files simultaneously  To create a log of specific data values read Which customers placed orders?  To create of record of calculated values Will I go out of stock on any these orders?  To create additional output What page number will this item be on? PUTDDREC

Hidden Gems In Expressions PUTDDREC syntax: PUTDDREC(ddname, dd_len, record_string, record_len, outfield) ddname - ddname assigned by filedef to output file dd_len - length of the ddname record_string - string of characters to write to file or field containing that string record_len - length of the string to be included outfield - return code  Output file must be filedef’d  DEFINE/COMPUTE field format always I1  Handles open, write and close

Hidden Gems In Expressions FILEDEF PUTDD1 DISK putdd1.dat TABLE FILE EMPLOYEE PRINT EMP_ID CURR_JOBCODE AS 'JOB' CURR_SAL COMPUTE SALA/A12 = EDIT(CURR_SAL); NOPRINT COMPUTE EMP1/A50= LAST_NAME|FIRST_NAME|EMP_ID|CURR_JOBCODE|SALA; NOPRINT COMPUTE OUT1/I1 = PUTDDREC('PUTDD1',6, EMP1, 50, OUT1); BY LAST_NAME BY FIRST_NAME END PUTDDREC in Action

Hidden Gems In Expressions LAST_NAME FIRST_NAME EMP_ID JOB CURR_SAL OUT BANNING JOHN A17 $29, BLACKWOOD ROSEMARIE B04 $21, CROSS BARBARA A17 $27, GREENSPAN MARY A07 $9, IRVING JOAN A15 $26, JONES DIANE B03 $18, MCCOY JOHN B02 $18, MCKNIGHT ROGER B02 $16, ROMANS ANTHONY B04 $21, SMITH MARY B14 $13, RICHARD A01 $9, STEVENS ALFRED A07 $11, Report Created

Hidden Gems In Expressions BANNING JOHN A BLACKWOOD ROSEMARIE B CROSS BARBARA A GREENSPAN MARY A IRVING JOAN A JONES DIANE B MCCOY JOHN B MCKNIGHT ROGER B ROMANS ANTHONY B SMITH MARY B SMITH RICHARD A STEVENS ALFRED A Sequential File Created

Hidden Gems In 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 Gems In 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 PDF 2. Including all styling required 3. Add NOPRINTED COMPUTE that – 1. Tests for a change of sort break 2. Uses PUTDDREC to put values in file  &TABPAGENO  Sort Break Value 4. Create pdf index request using index output 5. Run original request as compound pdf, followed by index request, creating single pdf.

Y Hidden Gems In Expressions  Standardization  Corporate business logic  FOCUS/WebFOCUS coding standards  Simplification  Complicated groups of expressions  Repeated groups of expressions  Creation  New subroutines currently unavailable  Customization of existing functions  Based on the FOCUS/WebFOCUS language  Creating your own business related functions

Hidden Gems In 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 Gems In 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 number  Use 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 number  Use arguments, constants and other temporary fields declared in the function.  Use all operators and most functions

Hidden Gems In 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 Gems In 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 CAR PRINT COUNTRY CAR MODEL SALES AND COMPUTE MARGIN/D5.2 = MARGIN(RETAIL_COST,DEALER_COST); WHERE MARGIN(RETAIL_COST, DEALER_COST) GT 20 END DEFINE FUNCTION MARGIN CLEAR DEFINE FUNCTION MARGIN (RC/D7, DC/D7) NETPROFIT/D7=RC-DC; MARGIN/D5.2=(NETPROFIT*100)/DC; END TABLE FILE CAR PRINT COUNTRY CAR MODEL SALES AND COMPUTE MARGIN/D5.2 = MARGIN(RETAIL_COST,DEALER_COST); WHERE MARGIN(RETAIL_COST, DEALER_COST) GT 20 END

Y Hidden Gems In Expressions  Easily accessed throughout WebFOCUS  Connected to Master File?  DF. Operator  Dynamic load and run of function  Function location indicated  Additional characteristics available  Description Functions in Master Files?

Hidden Gems In Expressions

DEFINE FUNCTION DMDATFMT DESCRIPTION '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 DMPROPER DESCRIPTION '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 DMDATFMT DESCRIPTION '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 DMPROPER DESCRIPTION '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 Gems In Expressions

AGENT1 AGENT_TALK AGENT_TALK1 TTIME TTIME1 ALLEN :03:20 00:05:00 BILL :05:00 00:06:40 CARL :10:20 00:08:40 DAN :06:40 00:15: TOTAL :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 HOURS HR/I2 = SEC/3600; HR_R/I2 = SEC -(HR* 3600) ; -* CALCULATE MIN MI/I2 = (HR_R / 60); -* CALCULATE SECONDS SC_D/I2 = SEC -((MI * 60) + HR); HRMISC/A8 = EDIT(HR) || ':' || EDIT(MI) || ':' || EDIT(SC_D) ; END DEFINE FUNCTION HRMISC (SEC/I10) -* CALCULATE HOURS HR/I2 = SEC/3600; HR_R/I2 = SEC -(HR* 3600) ; -* CALCULATE MIN MI/I2 = (HR_R / 60); -* CALCULATE SECONDS SC_D/I2 = SEC -((MI * 60) + HR); HRMISC/A8 = EDIT(HR) || ':' || EDIT(MI) || ':' || EDIT(SC_D) ; END Hidden Gems In Expressions SOLUTION :

Copyright 2007, Information Builders. Slide 61 Hidden Gems In Sorting  Automatic summary column creation

Hidden Gems In Sorting TABLE FILE GGSALES SUM UNITS AS 'UNITS' DOLLARS AS 'DOLLARS' BY PRODUCT BY REGION BY DATE WHERE DATE FROM TO ; WHERE PRODUCT EQ 'Capuccino' OR 'Espresso'; ON DATE SUB-TOTAL AS 'REGION TOTAL' ON TABLE SUB-TOTAL END TABLE FILE GGSALES SUM UNITS AS 'UNITS' DOLLARS AS 'DOLLARS' BY PRODUCT BY REGION BY DATE WHERE DATE FROM TO ; WHERE PRODUCT EQ 'Capuccino' OR 'Espresso'; ON DATE SUB-TOTAL AS 'REGION TOTAL' ON TABLE SUB-TOTAL END You know the effect of SUB-TOTAL on a BY field… Product Region Date UNITS DOLLARS Capuccino Northeast 1997/08/ REGION TOTAL 1997/08/ REGION TOTAL 1997/12/ *TOTAL REGION Northeast Product Region Date UNITS DOLLARS Capuccino Northeast 1997/08/ REGION TOTAL 1997/08/ REGION TOTAL 1997/12/ *TOTAL REGION Northeast

Hidden Gems In Sorting TABLE FILE GGSALES SUM UNITS AS 'UNITS' OVER DOLLARS AS 'DOLLARS' OVER BY PRODUCT ACROSS REGION ACROSS DATE ON DATE SUB-TOTAL AS 'REGION' ON TABLE SUB-TOTAL WHERE DATE FROM TO ; WHERE PRODUCT EQ 'Capuccino' OR 'Espresso'; END TABLE FILE GGSALES SUM UNITS AS 'UNITS' OVER DOLLARS AS 'DOLLARS' OVER BY PRODUCT ACROSS REGION ACROSS DATE ON DATE SUB-TOTAL AS 'REGION' ON TABLE SUB-TOTAL WHERE DATE FROM TO ; WHERE PRODUCT EQ 'Capuccino' OR 'Espresso'; END Now see the effect of SUB-TOTAL on an ACROSS field… Region Midwest West TOTAL MNTH Product NOV DEC REGION NOV DEC REGION Capuccino UNITS DOLLARS Espresso UNITS DOLLARS TOTAL UNITS DOLLARS Region Midwest West TOTAL MNTH Product NOV DEC REGION NOV DEC REGION Capuccino UNITS DOLLARS Espresso UNITS DOLLARS TOTAL UNITS DOLLARS

Hidden Gems In Sorting TABLE FILE GGSALES SUM UNITS AS 'UNITS' DOLLARS AS 'DOLLARS' COMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT PRICE' BY PRODUCT BY REGION BY DATE WHERE DATE FROM TO ; WHERE PRODUCT EQ 'Capuccino' OR 'Espresso'; ON DATE SUMMARIZE AS 'REGION TOTAL' ON TABLE SUMMARIZE END TABLE FILE GGSALES SUM UNITS AS 'UNITS' DOLLARS AS 'DOLLARS' COMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT PRICE' BY PRODUCT BY REGION BY DATE WHERE DATE FROM TO ; WHERE PRODUCT EQ 'Capuccino' OR 'Espresso'; ON DATE SUMMARIZE AS 'REGION TOTAL' ON TABLE SUMMARIZE END You know the effect of SUMMARIZE on a BY field… Product Region Date UNITS DOLLARS UNIT PRICE Capuccino Northeast 1997/08/ REGION TOTAL 1997/08/ REGION TOTAL 1997/12/ *TOTAL REGION Northeast Product Region Date UNITS DOLLARS UNIT PRICE Capuccino Northeast 1997/08/ REGION TOTAL 1997/08/ REGION TOTAL 1997/12/ *TOTAL REGION Northeast

Hidden Gems In Sorting TABLE FILE GGSALES SUM UNITS AS 'UNITS' OVER DOLLARS AS 'DOLLARS' OVER COMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT PRICE' BY PRODUCT ACROSS REGION ACROSS DATE ON DATE SUMMARIZE AS 'REGION' ON TABLE SUMMARIZE WHERE DATE FROM TO ; WHERE PRODUCT EQ 'Capuccino' OR 'Espresso'; END TABLE FILE GGSALES SUM UNITS AS 'UNITS' OVER DOLLARS AS 'DOLLARS' OVER COMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT PRICE' BY PRODUCT ACROSS REGION ACROSS DATE ON DATE SUMMARIZE AS 'REGION' ON TABLE SUMMARIZE WHERE DATE FROM TO ; WHERE PRODUCT EQ 'Capuccino' OR 'Espresso'; END Now see the effect of SUMMARIZE on an ACROSS field… Region Midwest West TOTAL MNTH Product NOV DEC REGION NOV DEC REGION Capuccino UNITS DOLLARS UNIT PRICE Espresso UNITS DOLLARS UNIT PRICE TOTAL UNITS DOLLARS UNIT PRICE Region Midwest West TOTAL MNTH Product NOV DEC REGION NOV DEC REGION Capuccino UNITS DOLLARS UNIT PRICE Espresso UNITS DOLLARS UNIT PRICE TOTAL UNITS DOLLARS UNIT PRICE SUB-TOTAL SUBTOTAL SUMMARIZE RECOMPUTE

Hidden Gems In Sorting TABLE FILE GGSALES SUM UNITS AS 'UNITS' OVER DOLLARS AS 'DOLLARS' OVER COMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT PRICE' BY PRODUCT ACROSS REGION ACROSS DATE ON DATE SUMMARIZE AS 'REGION' ON TABLE SUMMARIZE WHERE DATE FROM TO ; WHERE PRODUCT EQ 'Capuccino' OR 'Espresso'; END TABLE FILE GGSALES SUM UNITS AS 'UNITS' OVER DOLLARS AS 'DOLLARS' OVER COMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT PRICE' BY PRODUCT ACROSS REGION ACROSS DATE ON DATE SUMMARIZE AS 'REGION' ON TABLE SUMMARIZE WHERE DATE FROM TO ; WHERE PRODUCT EQ 'Capuccino' OR 'Espresso'; END  Currently requires text mode  Triggered with ON SUMMARIZE AS ‘title’  Style as DATA, OBJECT, or COLUMN

Hidden Gems Where 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?