More Hidden Gems in the World of Reporting: Part 5

Slides:



Advertisements
Similar presentations
CSCI 6962: Server-side Design and Programming Input Validation and Error Handling.
Advertisements

McGyver for Dynamic Subtotals/Subfoots Presented by David Smith of Brinker International.
Copyright 2007, Information Builders. Slide 1 Non-Relational Efficiencies Walter F. Blood Technical Director Information Builders, Inc.
Copyright 2007, Information Builders. Slide 1 Accumulation Techniques for Reporting with WebFOCUS Kyle Hachey Systems Engineer.
1 Copyright 2007, Information Builders. Slide 1 Nat Poe WebFOCUS Debugging Techniques.
Introduction to Structured Query Language (SQL)
Structured Query Language Part I Chapter Three CIS 218.
Introduction to Structured Query Language (SQL)
Lecture 6 29/1/15. Number functions Number functions take numbers as input, change them, and output the results as numbers. 2.
SQL Query Extras MIS 433. Rerunning the last Query n Type the forward slash “/” to rerun the last query that was entered.
Introduction to Query Part 2. Query Topics Joining Files Defining Result Fields Complex Record Selection Formatting Output Creating Reports Using Multiple.
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
“You Asked For It, You Got It!” Best New [Backend ] Features of WebFOCUS Renee Teatro Information Builders December 2011.
“You Asked For It, You Got It!” Best New [Backend ] Features of WebFOCUS Walter Blood Noreen Redden Joel Starkman Information Builders, Inc. August,
Objects for Business Reporting MIS 497. Objective Learn about miscellaneous objects required for business reporting. Learn about miscellaneous objects.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 3 Analyzing Data and Creating Reports.
Analyzing Data For Effective Decision Making Chapter 3.
CS 403: Programming Languages Fall 2004 Department of Computer Science University of Alabama Joel Jones.
SQL: Data Manipulation Presented by Mary Choi For CS157B Dr. Sin Min Lee.
Examining data using Microsoft Access Queries Using Criteria and Calculations SESSION 3.2 This section covers specifying an exact match condition in a.
ISV Innovation Presented by ISV Innovation Presented by Business Intelligence Fundamentals: Data Cleansing Ola Ekdahl IT Mentors 9/12/08.
1 Lab 2 and Merging Data (with SQL) HRP223 – 2009 October 19, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning:
Oracle 11g: SQL Chapter 10 Selected Single-Row Functions.
May 10, 2012 Version 7 Release 7.03 Ira Kaplan WebFOCUS New Features 1.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
A Guide to SQL, Seventh Edition. Objectives Understand how to use functions in queries Use the UPPER and LOWER functions with character data Use the ROUND.
Database Applications – Microsoft Access Lesson 4 Working with Queries 36 Slides in Presentation.
XP. Objectives Sort data and filter data Summarize an Excel table Insert subtotals into a range of data Outline buttons to show or hide details Create.
Copyright 2007, Information Builders. Slide 1 FOCUS Internals: Part 2 Update for 7.6.x Renee Teatro FUN Conference August 2008 Internals of Output Processing.
Copyright © 2004, Oracle. All rights reserved. Lecture 4: 1-Retrieving Data Using the SQL SELECT Statement 2-Restricting and Sorting Data Lecture 4: 1-Retrieving.
Copyright 2007, Information Builders. Slide 1 Hidden Gems Walter F. Blood Technical Director Information Builders, Inc.
Copyright 2007, Information Builders. Slide 1 TABLE FILE: The Basics Noreen Redden FOCWizard June, 2008.
Lesson 4: Querying a Database. 2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Set query.
Emdeon Office Batch Management Services This document provides detailed information on Batch Import Services and other Batch features.
N5 Databases Notes Information Systems Design & Development: Structures and links.
Fundamentals of DBMS Notes-1.
Microsoft Office Access 2010 Lab 3
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha
Relational Database Design
A Guide to SQL, Seventh Edition
Chapter 10 Selected Single-Row Functions Oracle 10g: SQL
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Download/Upload Inventory
The Database Exercises Fall, 2009.
Using the Set Operators
Intro to PHP & Variables
Using the Set Operators
GO! with Microsoft® Access e
Prof: Dr. Shu-Ching Chen TA: Yimin Yang
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha
Chapter # 7 Introduction to Structured Query Language (SQL) Part II.
Prof: Dr. Shu-Ching Chen TA: Haiman Tian
Creating Tables & Inserting Values Using SQL
MongoDB Aggregations.
Lab 2 and Merging Data (with SQL)
M1G Introduction to Database Development
Reporting Aggregated Data Using the Group Functions
Lab 2 HRP223 – 2010 October 18, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
Contents Preface I Introduction Lesson Objectives I-2
Spreadsheets, Modelling & Databases
Projecting output in MySql
MongoDB Aggregations.
Joins and other advanced Queries
Reporting Aggregated Data Using the Group Functions
Using the Set Operators
Reporting Aggregated Data Using the Group Functions
Shelly Cashman: Microsoft Access 2016
Upload/Download Inventory
Upload/Download Inventory
Introduction to SQL Server and the Structure Query Language
Presentation transcript:

More Hidden Gems in the World of Reporting: Part 5 Walter F. Blood Director of Product Management Information Builders

Where We Will Look Settings Connections Expressions Sorting Adding “stuff” to the Hold Master - HOLDSTAT The catch-all for formatting - PRINTPLUS When the data doesn’t line up - JOINOPT Connections Combining tables based on ranges Connecting tables with nothing in common Connect files to create the exact record you need Expressions Working with more than one record instance at a time Writing to multiple files simultaneously Using SQL friendly user functions Sorting Sorting it your way Uneven grouping

Add stuff to the HOLD Master …In Settings Add stuff to the HOLD Master Catch-all for fomatting When data doesn’t line up Copyright 2007, Information Builders. Slide 3 3

Switches that affect behavior – scope varies 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

SET HOLDSTAT= OFF/ON/filename Automatically add “stuff” to a HOLD Master Comments at the beginning or the end DEFINE fields, COMPUTE fields SORTOBJ objects, FILTER objects, STYLE objects DBA Pre-existing HOLDSTAT or other name file Create dynamically in MFD_PROFILE Remember Comment - $ $BOTTOM used to place stuff at end of master $ mystat.err $ Included comments $ Can be dynamically created in MFD Profile $BOTTOM DEFINE COUNTRY/A5=EDIT(COUNTRY,’9$9$9$9$9$’);,$ END DBAFILE = filename $ More comments

SET - PRINTPLUS Turning PRINTPLUS ON – BY field actions are linked with BY field options so they appear together SET PRINTPLUS=OFF TABLE FILE CAR HEADING "PRINTPLUS=OFF" SUM SEATS CNT.BODYTYPE COMPUTE AVE/D6.2 = SEATS/CNT.BODYTYPE; BY COUNTRY BY CAR BY MODEL ON COUNTRY SUBTOTAL ON COUNTRY SUBFOOT "COUNTRY SUBFOOT - SUBTOTAL <COUNTRY>" ON CAR RECOMPUTE ON CAR SUBFOOT "CAR SUBFOOT - RECOMPUTE <CAR>" ON TABLE SUMMARIZE ON TABLE SUBFOOT "TABLE SUBFOOT - SUMMARIZE" ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = endeflt, $ ENDSTYLE END Paired Actions Paired Actions Paired Actions

SET- PRINTPLUS Turning PRINTPLUS ON – BY field actions are linked with BY field options so they appear together Paired Actions ?

SET - PRINTPLUS Turning PRINTPLUS ON – BY field actions are linked with BY field options so they appear together Paired Actions !

SET - PRINTPLUS Turning PRINTPLUS ON – Splitting fields linked by OVER onto separate pages no longer occurs SET LINES=18,PAPER=21 TABLE FILE CAR SUM RCOST OVER DCOST OVER SALES OVER MPG BY COUNTRY SKIP-LINE END PRINTPLUS OFF PRINTPLUS ON

SET - PRINTPLUS Turning PRINTPLUS ON – Report SUBFOOT now prints above the footing instead of below it. TABLE FILE CENTORD SUM CENTORD.INVSEG.PRICE BY LOWEST CENTORD.OINFO.STORE_CODE BY LOWEST CENTORD.INVSEG.PROD_NUM BY TOTAL LOWEST CENTORD.OINFO.ORDER_DATE ON TABLE SUBHEAD "PRINTPLUS IS OFF" FOOTING "This report was created for &DATEMtrYY " ON TABLE SUBFOOT "This is the Report Footing for <STORE_CODE" IF CENTORD.OINFO.STORE_CODE EQ '1003CA' …. END FOOTING REPORT SUBFOOT

SET - PRINTPLUS Turning PRINTPLUS ON – Report SUBFOOT now prints above the footing instead of below it.

SET - PRINTPLUS Turning PRINTPLUS ON – PAGE-BREAK handled internally - provide the correct spacing of pages NOSPLIT handled internally RECAPs in cases where pre-specified conditions are met FOOTING no longer splits on two pages Footings and Subfoots - on page with at least one data item Printing beyond the length of the page no longer occurs There is no reserved space for conditional output The order of sort fields is no longer relevant

When the retrieved data values don’t line up correctly SET - JOINOPT When the retrieved data values don’t line up correctly TRAIN ROUTES Route Number Origin Station Dest Station TRAIN ROUTES ORIGIN STATIONS Orig Station Orig City Orig State DESTINATION STATIONS TRAIN ROUTES Dest Station Dest City Dest State JOIN TR TO OR - UNIQUE JOIN TR TO DS - UNIQUE 1:M

When the retrieved data values don’t line up correctly SET - JOINOPT When the retrieved data values don’t line up correctly TRAIN ROUTES TABLE FILE ROUTES PRINT TRAIN_NUM OR_STATION OR_CITY DE_STATION DE_CITY END ORIGIN STATIONS DESTINATION STATIONS TRAIN_NUM OR_STATION OR_CITY DE_STATION DE_CITY --------- ---------- ------- ---------- ------- 101 NYC NEW YORK ATL . 202 BOS BOSTON BLT ATLANTA 303 DET DETROIT BOS BALTIMORE 404 CHI CHICAGO DET BOSTON 505 BOS BOSTON STL DETROIT 505 BOS . STL ST. LOUIS TRAIN ROUTES TRAIN ROUTES

When the retrieved data values don’t line up correctly SET - JOINOPT When the retrieved data values don’t line up correctly TRAIN ROUTES TABLE FILE ROUTES PRINT TRAIN_NUM OR_STATION OR_CITY DE_STATION DE_CITY END SET JOINOPT=GNTINT ORIGIN STATIONS DESTINATION STATIONS TRAIN_NUM OR_STATION OR_CITY DE_STATION DE_CITY --------- ---------- ------- ---------- ------- 101 NYC NEW YORK ATL ATLANTA 202 BOS BOSTON BLT BALTIMORE 303 DET DETROIT BOS BOSTON 404 CHI CHICAGO DET DETROIT 505 BOS BOSTON STL ST. LOUIS TRAIN ROUTES TRAIN ROUTES

Connect files based on a range of values Connections Connect files based on a range of values Connect files with NO apparent connection Connect files to create the exact record you need

Connections Based on Equality EMPLOYEE ID LAST NAME FIRST NAME HIRE DATE CURRENT SALARY … Employee TAX YEAR TAX RATE MINIMUM SALARY MAXIMUM SALARY Tax Rate Standard JOIN based upon EQUALITY comparison JOIN field IN file TO ALL field IN file AS name

Connections Based on Equality

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

Connections Based on Range

Insurance Rates – Listing Problem: Selecting the correct insurance rate based upon age from a table with ranges--- Minimum Maximum Age Age Insurance Rate 21 27 $ 8.00 28 34 $ 9.00 35 40 $10.00 41 44 $11.00 JOIN FILE EMPDATA1 AT BIRTHDATE TO ALL FILE RATES AT AGE AS J1 WHERE EMPDATA1.AGE GE RATES.MINAGE; WHERE EMPDATA1.AGE LE RATES.MAXAGE; END

JOIN? Connect files that have NO apparent connection Employee New Car Connections Connect files that have NO apparent connection Employee Salary History New Car Finance Packages JOIN?

Connections

Connections Employee Salary History New Car Finance Packages JOIN?

Connections – Conditional Join Conditional Join Considerations: Based upon Cartesian product WHERE condition controls selection – True/Select, False/Reject Complex WHEREs supported Multiple WHERE conditions supported At least one WHERE must contain fields from both files Remove WHERE – true cartesian product Copyright 2007, Information Builders. Slide 25 25

Sort Merge Creating the exact record you need! Connections - MATCH HOLD OLD NEW BYs and Verb control structure of output record AFTER MATCH HOLD controls selection of data being placed in the output record

Connections - MATCH Using BY fields Control both column order in record as well as connection To “MATCH” - must have same name in request – use AS MATCH up to 16 levels in a single MATCH request MATCH keys do not have to be the same! Matching keys - output in 1 column Non-matching keys – distinct columns Output record created based upon common keys Keys plus associated verb objects OLD to NEW for non-MATCHING key objects

Connections - MATCH Using PRINT or SUM SUM: Aggregates verb objects included in level Aggregation level based upon BYs at that level Output sequence controlled by order of request and BYs, and MATCH levels PRINT: Includes detail records for verb objects selected in level Grouped and sorted based upon BY fields Output sequence controlled by order of request and BYs , and MATCH levels

Connections - MATCH Holding Patterns CONTROL THE MISSING! OLD-OR-NEW – All RECORDS, both files (DEFAULT) OLD-AND-NEW—Common RECORDS only OLD-NOT-NEW – RECORDS in OLD missing in NEW NEW-NOT-OLD - RECORDS in NEW missing in OLD OLD-NOR-NEW - Combo of OLD-NOT-NEW NEW-NOT-OLD OLD – RECORDS in OLD with RECORDS in NEW NEW – RECORDS in NEW with RECORDS in OLD

Working with more than one record instance at a time Expressions Working with more than one record instance at a time Writing to multiple files simultaneously Using SQL friendly user functions

LAST Working with more than one record instance at a time THE FUNCTION Expressions - LAST Working with more than one record instance at a time LAST THE FUNCTION Available in COMPUTE, DEFINE, WHERE References the field value in the previous record Works with real and virtual fields

Expressions - LAST LAST

Expressions - LAST LAST Select LAST Get Fieldname

Expressions - LAST LAST In DEFINE

Expressions - LAST LAST In COMPUTE

LAST In WHERE Expressions - LAST CAR.ORIGIN.COUNTRY NE LAST CAR.ORIGIN.COUNTRY In WHERE

LAST Using LAST: Detecting value changes of data in ordered sets Expressions - LAST LAST 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 In WHERE

LAST LAST Considerations: The order the data is processed is critical Expressions - LAST LAST LAST Considerations: The order the data is processed is critical You may need to presort data to a hold file Limited optimization to relational databases Test DEFINES with WHERE Test COMPUTES with WHERE TOTAL In DEFINE In COMPUTE In WHERE Copyright 2007, Information Builders. Slide 38 38

Expressions - PUTDDREC Writing to multiple files simultaneously To create a log of specific data values read Which critical customers placed orders? To create of record of calculated values Will I go out of stock on any these orders today? To create additional output In this catalog what page number will this item be on? PUTDDREC

Expressions - PUTDDREC 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

PUTDDREC in Action 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

Expressions - PUTDDREC LAST_NAME FIRST_NAME EMP_ID JOB CURR_SAL OUT1 --------- ---------- --------- --- -------- ---- BANNING JOHN 119329144 A17 $29,700.00 0 BLACKWOOD ROSEMARIE 326179357 B04 $21,780.00 0 CROSS BARBARA 818692173 A17 $27,062.00 0 GREENSPAN MARY 543729165 A07 $9,000.00 0 IRVING JOAN 123764317 A15 $26,862.00 0 JONES DIANE 117593129 B03 $18,480.00 0 MCCOY JOHN 219984371 B02 $18,480.00 0 MCKNIGHT ROGER 451123478 B02 $16,100.00 0 ROMANS ANTHONY 126724188 B04 $21,120.00 0 SMITH MARY 112847612 B14 $13,200.00 0 RICHARD 119265415 A01 $9,500.00 0 STEVENS ALFRED 071382660 A07 $11,000.00 0 Report Created

Expressions - PUTDDREC Sequential File Created BANNING JOHN 119329144A17000000029700 BLACKWOOD ROSEMARIE 326179357B04000000021780 CROSS BARBARA 818692173A17000000027062 GREENSPAN MARY 543729165A07000000009000 IRVING JOAN 123764317A15000000026862 JONES DIANE 117593129B03000000018480 MCCOY JOHN 219984371B02000000018480 MCKNIGHT ROGER 451123478B02000000016100 ROMANS ANTHONY 126724188B04000000021120 SMITH MARY 112847612B14000000013200 SMITH RICHARD 119265415A01000000009500 STEVENS ALFRED 071382660A07000000011000

PUTDDREC Considerations: 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

Expressions - PUTDDREC Creating an Index in PDF with PUTDDREC Create a filedef for the index output file. Create request that you want to index. Including HOLD to PDF Including all styling required Add NOPRINTED COMPUTEs that – Test for a change of sort break Use PUTDDREC to put values in file &TABPAGENO Sort Break Value Create index formatting request using index output Run original request as compound pdf, followed by index request, creating single pdf.

SQL Friendly User Functions Expressions SQL Friendly User Functions CHARACTER CHAR_LENGTH (string) DIGITS (number, out length) LOWER (string) LPAD (string, out length, pad char) LTRIM (string) POSITION ( pattern, string) RPAD (string, out length, pad char) RTRIM (string) SUBSTRING (string, position, length) TOKEN (string, delimiter, number) TRIM_ (where, pattern, string) UPPER (string) NUMERIC ABS (number) CEILING (number) EXPONENT (power) FLOOR (number) INT (number) LOG ( number) MAX (num1, num2,…numn) MIN (num1, num2,…numn) MOD (dividend, divisor) POWER (base, power) SQRT (number)

SQL Friendly User Functions Expressions SQL Friendly User Functions DATE/DATETIME DTADD (date, component,increment) DTDIFF (enddate, startdate, component) DTPART (date, component) DTRUNC (date, period) GEOGRAPHIC GIS_GEOMETRY (geotype,wkid, geometry) GIS_IN_POLYGON (longitude, latitude, polygon_definition)

Sorting Sorting it Your way Uneven Grouping

Sorting – ROWS/COLUMNS Sorting it your way Sorting is done based on the collation sequence in the codepage in effect on your system AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBBBBBBBbBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Sorting – ROWS/COLUMNS Sorting it your way But what if you have a better way to do it! BY <field> ROWS <value> OVER <value>… AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD ACROSS <field> COLUMNS <value> OR <value>… GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG BBBBBBBBBBbBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

Sorting – ROWS/COLUMNS Sorting it your way BY <field> ROWS <value> OVER <value>… But what if you have a better way to do it! ACROSS <field> COLUMNS <value> OR <value>… Implicit selection – only values mentioned are retrieved Each value can have an AS phrase – relabeling Will affect SQL optimization

Sorting – ROWS/COLUMNS Sorting it your way

Sorting – PLUS OTHERS Uneven grouping When you only need the top 5 values – SUM SALES BY HIGHEST 5 SALESREPS And you want a total for all the other values? SUM SALES BY HIGHEST 5 SALESREPS PLUS OTHERS

Sorting – PLUS OTHERS Uneven grouping TABLE FILE CAR PRINT CAR.BODY.DEALER_COST CAR.COMP.CAR BY HIGHEST 2 CAR.BODY.SALES PLUS OTHERS AS 'Others'

Sorting – PLUS OTHERS Uneven grouping TABLE FILE CAR PRINT CAR.BODY.DEALER_COST CAR.COMP.CAR BY HIGHEST 2 CAR.BODY.SALES PLUS OTHERS AS 'Others'

More Hidden Gems - Where We Looked Adding “stuff” to the Hold Master Catch-all for formatting -PRINTPLUS When the data doesn’t line up Combining tables based on ranges Connecting tables with nothing in common Creating the exact record you need Working with more than one record instance at a time Writing to multiple files simultaneously Using SQL friendly user fuunctions Sorting it your way Uneven grouping Questions? 56