More Things You Can Use on Monday
Walter F. BloodTechnical Director
Copyright 2010, Information Builders. Slide 1
More Things You Can Use on Monday
AgendaSET ParametersReportingDialogue ManagerFunctionsTroubleshootingMy Top 5 from Last Year
Copyright 2010, Information Builders. Slide 2
SET Parameters
Copyright 2010, Information Builders. Slide 3
SET Parameters
A few more of my favourite SET parameters ACROSSLINE EMPTYCELLS EMPTYREPORT FILECOMPRESS FOCFIRSTPAGE CNOTATION OVERFLOWCHAR HIDENULLACRS
Working with SET Parameters
Copyright 2010, Information Builders. Slide 4
SET Parameters – ACROSSLINE
Controls the display the default line across the reportOptions: ON, OFF, SKIPDefault: ON
Copyright 2010, Information Builders. Slide 5
SET ACROSSLINE = ON SET ACROSSLINE = OFF
SET Parameters – ACROSSLINE
Controls the display the default line across the reportOptions: ON, OFF, SKIPDefault: ON
Copyright 2010, Information Builders. Slide 6
SET ACROSSLINE = SKIP
TITLELINEis a synonym forACROSSLINE
SET Parameters – EMPTYCELLS
Controls the content of null cells in Excel outputOptions: ON, OFFDefault: ON
SET EMPTYCELLS = ON SET EMPTYCELLS = OFF
SET Parameters – EMPTYCELLS
Works in conjunction with NODATA
SET EMPTYCELLS = OFFSET NODATA = 'No Data'
SET Parameters – EMPTYREPORT
Controls what is displayed if no data returnedOptions: ON, OFF, ANSIDefault: OFF
SET EMPTYREPORT = OFF
SET EMPTYREPORT = ANSI
SET EMPTYREPORT = ON
SET Parameters – FILECOMPRESS
Enables the compression of PDF report outputOptions: ON, OFFDefault: OFF
SET FILECOMPRESS = OFF
1.1 MB
SET FILECOMPRESS = ON
244 KB
SET Parameters – FOCFIRSTPAGE
Controls the first page number of a reportOptions: nDefault: 1
SET FOCFIRSTPAGE = 1 SET FOCFIRSTPAGE = 5
SET Parameters – FOCFIRSTPAGE
&FOCNEXTPAGE will tell you what the next page number will be after a report runs
Use with FOCFIRSTPAGE
SET FOCFIRSTPAGE = &FOCNEXTPAGE
&FOCNEXTPAGE = 5
SET Parameters – CNOTATION
Controls how columns are numbered for internal referencing during report processing
Options: ALL, PRINTONLY, EXPLICITDefault: ALL
TABLE FILE GGSALES SUM DOLLARS NOPRINT COMPUTE VARIANCE/D12M = DOLLARS - BUDDOLLARS; BY REGIONEND
SET Parameters – CNOTATION
TABLE FILE GGSALES SUM DOLLARS NOPRINT COMPUTE VARIANCE/D12M = DOLLARS - BUDDOLLARS; BY REGIONEND
REGION DOLLARS BUDDOLLARS VARIANCE
C1 C2 C3
SET CNOTATION = ALL
SET CNOTATION = PRINTONLYREGION DOLLARS BUDDOLLARS VARIANCE
C1
SET CNOTATION = EXPLICITREGION DOLLARS BUDDOLLARS VARIANCE
C1 C2
SET Parameters – OVERFLOWCHAR
Controls the character displayed on an overflowOptions: *, any characterDefault: *
OVERFLOWCHAR = * OVERFLOWCHAR = !
SET Parameters – HIDENULLACRS
Suppresses printing of null across columns on a pageOptions: ON, OFFDefault: OFF
SET HIDENULLACRS = OFF
SET HIDENULLACRS = ON
SET Parameters – Working with parameters
SET parameter values can be displayed
? SET ACROSSLINE
? SET ? SET ALL
SET Parameters – Working with parameters
SET parameter categories can be displayed
? SET CATEGORY REPORT
? SET CATEGORY DATES
SET Parameters – Working with parameters
SET parameters can be displayed by category CategoriesMEMORYDATESSECURITYSINKSENDCOMPUTATIONMDIEXTERNALSORTFOCCALCENVIRONMENTWEBFOCUSREPORTGRAPHSTYLESHEETRETRIEVALHOLDPLATFORMMAINFRAME
? SET BY CATEGORY
SET Parameters – Working with parameters
SET parameter values can be explained
? SET FOR ACROSSLINE
SET Parameters – Working with parameters
SET parameter values can be captured
SET parameter values can be used
-? SET ACROSSLINE &SETTING
&SETTING = ON
-? SET ACROSSLINE &SETTING
-IF &SETTING EQ 'ON' THEN GOTO …
Reporting
Copyright 2010, Information Builders. Slide 22
Reporting – DEFINE Functions
Subroutines based on WebFOCUS DEFINEsTake arguments and return resultsCan be used with any data file
As a compute, serves a very specific purposeHow do we make it more useable?
COMPUTE DOLPERUNIT/D12.2 = DOLLARS / UNITS;
Reporting – DEFINE Functions
Create a DEFINE function
Use the function in the COMPUTE
DEFINE FUNCTION PERUNIT (VALUE/D12, QTY/I9) PERUNIT/D12.2 = VALUE / QTY ;END
COMPUTE DOLPERUNIT/D12.2=PERUNIT(DOLLARS,UNITS);
Reporting – DEFINE Functions
Creates a reusable and consistent function
COMPUTE DOLPERUNIT/D12.2 = PERUNIT(DOLLARS,UNITS);
COMPUTE BUDPERUNIT/D12.2 = PERUNIT(BUDDOLLARS,BUDUNITS);
Reporting – DEFINE Functions
DEFINE FUNCTION name (arg1/fmt1,..., argn/fmtn)
[tempvariablea/formata = expressiona;]...[tempvariablex/formatx = expressionx;]
name/format = [result_expression];
END
Syntax
Reporting – DEFINE Functions
Usage Notes
The number of functions you can define and use in a session is virtually unlimited
Only cleared by DEFINE FUNCTION CLEAR command
Function names can be up to 64 characters.
Argument names are limited to 12 characters
No limit to the number of arguments
Can call other DEFINE functions, but cannot call themselves
If a DEFINE function isn’t available
(FOC03665) Error loading external function '%1'
Reporting – FILTER FILE
Automatic filtering in reports and graphsCan be activated and deactivated as required
FILTER FILE GGSALES NAME = MIDWEST WHERE REGION EQ 'Midwest';END
Define the Filter
SET FILTER = MIDWEST IN GGSALES ON
Activate the Filter
Reporting – FILTER FILE
FILTER FILE GGSALES NAME = MIDWEST WHERE REGION EQ 'Midwest';END
TABLE FILE GGSALES SUM DOLLARS UNITS BY REGIONEND
SET FILTER = MIDWEST IN GGSALES OFF
SET FILTER = MIDWEST IN GGSALES ON
Reporting – FILTER FILE
FILTER FILE GGSALES
NAME = MIDWEST WHERE REGION EQ 'Midwest';
NAME = NTHEAST WHERE REGION EQ 'Northeast';
NAME = STHEAST WHERE REGION EQ 'Southeast';
NAME = WEST WHERE REGION EQ 'West';
END
SET FILTER =
STHEAST IN GGSALES ON
WEST IN GGSALES ON
MIDWEST IN GGSALES ON
NTHEAST IN GGSALES ON
Reporting – FILTER FILE
FILTER FILE GGSALES
NAME = MIDWEST WHERE REGION EQ 'Midwest';
NAME = COFFEE WHERE PRODUCT CONTAINS 'Coffee';
END
SET FILTER = MIDWEST COFFEE IN GGSALES ON
Reporting – FILTER FILE
Once activated, will apply to all subsequent reportsApply variable selections passed in from formsEnforce row level securityAvoid Dialogue Manager code inside a TABLE FILE
-DEFAULT &SETFILTER=OFFSET FILTER = MIDWEST IN GGSALES &SETFILTERTABLE FILE GGSALES SUM DOLLARS UNITS BY REGION BY PRODUCTEND
TABLE FILE GGSALES SUM DOLLARS UNITS BY REGION BY PRODUCT
-IF &SETFILTER EQ 'OFF' THEN - GOTO NO_FILTER; WHERE REGION EQ 'Midwest';-NO_FILTER
END
VS
Reporting – Hold Files
ON TABLE HOLD directly to an app folderHOLD AS app/filename
Puts summit.ftm into the baseapp app folderTo capture summit.mas still needs APP HOLDMETA
TABLE FILE GGSALES SUM DOLLARS BY REGION ON TABLE HOLD AS baseapp/summit.ftmEND
Reporting – Hold File Delimiter
Select any character as your column delimiter
ON TABLE HOLD AS HDATA FORMAT DFIX DELIMITER '~'
Midwest~11400665Northeast~11392300Southeast~11710379West~11652946
SEGNAME=HDATA, DELIMITER=~, HEADER=YES, $
Region~Dollar Sales Midwest~11400665Northeast~11392300Southeast~11710379West~11652946
ON TABLE HOLD AS HDATA FORMAT DFIX DELIMITER '~' HEADER YES
SEGNAME=HDATA, DELIMITER=~, HEADER=NO, $
Dialogue Manager
Copyright 2010, Information Builders. Slide 35
Dialogue Manager – Testing for Operating System
&FOCMODE Returns the operating system you are running in Enables you to take action based on where you are Values: WINNT, UNIX, etc.
-IF &FOCMODE EQ 'UNIX' THEN GOTO UNIX_STUFF - ELSE GOTO WIN_STUFF;
Dialogue Manager – .EXISTS
Indicates if an & variable exists (has value)Can be used to control navigation
0 = variable does not exist 1 = variable exists
-IF ®ION.EXIST EQ 0 THEN GOTO GET_REGION - ELSE GOTO RUN_REPORT;
Dialogue Manager – .EVAL
Resolves & variables in a pre-parse of Dialogue ManagerEnables resolved variables to be used in DM code
-SET ®ION = 'West';-SET &TITLE = 'Report for ®ION';
-SET ®ION = 'West';-SET &TITLE = 'Report for ®ION.EVAL';
Dialogue Manager – .QUOTEDSTRING
Automatically and intelligently puts quotes around & variables
TABLE FILE EMPDATE PRINT NAME IF NAME EQ &NAME.QUOTEDSTRINGEND
&NAME = John Smith
TABLE FILE EMPDATE PRINT NAME IF NAME EQ &NAMEEND
&NAME = John O’Brian
Dialogue Manager – .LENGTH
Returns the length of an & variable valueCan be used for edit checking and to control navigation
-IF ®ION.LENGTH LT 10 THEN GOTO SHORT_REGION - ELSE GOTO LONG_REGION;
-SET ®ION = 'West';
®ION.LENGTH = 4
-SET ®ION = 'West ';
®ION.LENGTH = 10
-SET ®ION = 'West ';-SET ®ION = TRUNCATE(®ION);
®ION.LENGTH = 4
Dialogue Manager – .TYPE
Returns the type of an & variable valueCan be used for edit checking and to control navigation
A = alphanumeric N = numeric
-SET ®ION = 'West';
®ION.TYPE = A
-SET ®ION = '12345';
®ION.TYPE = N
-IF ®ION.TYPE EQ A THEN GOTO ALPHA_REGION - ELSE GOTO NUM_REGION;
Dialogue Manager – DEFAULTH
Sets a default value for hidden & variablesHidden & variables are not prompted for
Autoprompt, MR Publish Utility, HTML Composer, ReportCaster Scheduling
-DEFAULT &ORDERDATE=19970101
-DEFAULTH &ORDERDATE=19970101
Functions
Copyright 2010, Information Builders. Slide 43
Functions
A few more of my favourite functions UPCASE LOCASE LCWORD FPRINT
Functions – UPCASE
Convert a string to upper caseUPCASE(length, input, outfield)
UP_REGION/A11=UPCASE(11,REGION,UP_REGION);
Functions – LOCASE
Convert a string to lower case LOCASE(length, input, outfield)
LO_REGION/A11=LOCASE(11,REGION,UP_REGION);
Functions – LCWORD
Convert a string to lower case LCWORD(length, string, outfield)
MX_COUNTRY/A10=LCWORD(10, COUNTRY, MX_COUNTRY);
Functions – FPRINT
Convert any numeric data to the alpha display you wantFPRINT(infield, format, outfield)
ADOLLARS/A20= FPRINT(DOLLARS,'D12M',ADOLLARS);SALES/A30= 'Sales = ' | ADOLLARS;
Troubleshooting
Copyright 2010, Information Builders. Slide 49
SQL Tracing - TRACESTAMP
Controls the display of the time stamp on SQL traceOptions: ON, OFFDefault: ON
Copyright 2010, Information Builders. Slide 50
SET TRACESTAMP = ON SET TRACESTAMP = OFF
SET TRACESTAMP=OFFSET TRACEOFF=ALLSET TRACEON=SQLAGGR//CLIENTSET TRACEON=STMTRACE//CLIENTSET TRACEUSER=CLIENT
Developer Studio – Comments
Copyright 2010, Information Builders. Slide 51
CTRL-M
CTRL-R
Developer Studio – I forgot to press Caps Lock
Copyright 2007, Information Builders. Slide 52
Have you ever typed this …
And wanted to type this …
Developer Studio – I forgot to press Caps Lock
Copyright 2007, Information Builders. Slide 53
+
=
Who, What, Where am I
Copyright 2007, Information Builders. Slide 54
What’s my site code?
? SITECODE
What release am I running?
? RELEASE
My Top 5 from Last Year
Copyright 2010, Information Builders. Slide 55
SET Parameters – DMPRECISION
Controls decimal precision of & variablesOptions: OFF, nDefault: OFF If OFF, everything is an integerOtherwise, you decide
-SET &TEST = 123.45 + 5.43;-TYPE TEST = &TEST
SET DMPRECISION = OFFTEST = 128.88&TEST = 128
SET DMPRECISION = 1&TEST = 128.9
SET DMPRECISION = 2&TEST = 128.88
Dialogue Manager – ASIS
In a Dialogue Manager variable blank = 0 = ' 0' = ' 0000'Dialogue Manager variables have no formatASIS allows us to test the true value of the variable
-SET &VAR1 = ' ';-SET &VAR2 = 0;
&VAR1 EQ &VAR 2 = TRUE
but
ASIS(&VAR1) EQ ASIS(&VAR 2) = FALSE
ASIS(&VAR1) EQ 0 = FALSE
ASIS(&VAR2) EQ ‘ ’ = FALSE
Lookup a value in one data source while reading anotherNo JOIN requiredNot a replacement for JOIN – use when appropriateDB_LOOKUP(look_mf, srcfld1, lookfld1, srcfld2, lookfld2, ...,
returnfld)
Functions – DB_LOOKUP
MANAGER/A10 = DB_LOOKUP (FINANCE, REGION, REGION, SALES_MANAGER);
Currency conversionConsistent conversion based on standard ratesNo JOIN to an exchange rate table required
DEFINE Functions and DB_LOOKUP
Month Country Sales Currency
2011/05 Germany $85,657.14 EUR
2011/04 Germany $30,286.37 EUR
2011/03 Germany $25,578.56 EUR
Month Currency Rate
2011/05 EUR 1.45359
2011/04 EUR 1.44484
2011/03 EUR 1.39992
Sales Data
Exchange Rates
Create a DEFINE Function to convert any value
DEFINE FUNCTION CONVERT (MONTH/A6, CURRENCY/A3, VALUE/D15.2)
RATE/D15.6 = DB_LOOKUP (XCHG_RATE, MONTH, RATE_MONTH, CURRENCY, CURRENCY, RATE);
CONVERT/D12.2 = VALUE * RATE;
END
DEFINE Functions and DB_LOOKUP
Use the function in a report
TABLE FILE SALESSUM SALESCOMPUTE USD_SALES/D12.2= CONVERT(SALES_MONTH, CURRENCY, SALES);BY COUNTRYBY SALES_MONTHIF COUNTRY EQ 'GERMANY'END
DEFINE Functions and DB_LOOKUP
Missing Data – In calculations
Example:
Sales in HR is missing but treated like 0 in the calculation Is this right?Results of calculations can be made “missing” based on
availability of components
PROFIT/D12 = SALES – COSTS;
Department Sales Costs Profit
East 100 90 10
HR . 90 -90
West 0 90 -90
Missing Data – In calculations (cont)
Calculation: Supports a result of MISSING (MISSING ON) Demands that all components be present (NEEDS ALL)
Now HR has profit of MISSING because SALES is MISSINGNEEDS ALL could also be NEEDS SOMESupported in Dev Studio
PROFIT/D12 MISSING ON NEEDS ALL = SALES – COSTS;
Department Sales Costs Profit
East 100 90 10
HR . 90 .
West 0 90 -90
Troubleshooting – WHENCE
Shows where a selected module is being pulled fromCan search for Focexecs, Master Files and Access Files
WHENCE focexec FOCEXEC WHENCE masterfile MASTER WHENCE accessfile ACCESS
Returns physical location of the moduleVerify you are accessing and using the one you think you are
WHENCE car MASTER
WHENCE portfolio ACCESS
WHENCE controlchart FOCEXEC
IB Tech Support as a Search Engine
Copyright 2010, Information Builders. Slide 65
IB Tech Support as a Search Engine
Go to:http://www.microsoft.com/windows/ie/searchguide/en-en/default.mspx
Complete the form on the right to
IB Tech Support as a Search Engine
URL for search provider
Descriptive Name
To find the required URL:Open a new browser window or tabAccess the IB Enterprise Content Library
http://ecl.informationbuilders.com/ecl/searchSearch for TEST (upper case)Copy the URL in the address barPaste the URL into the form
IB Tech Support as a Search Engine
After filling out the form, press Install
IB Tech Support as a Search Engine
Press Add on the confirmation panel
Your all setClick on the Search Providers drop
down IB Tech Support is now listed
Select it and enter search criteria
IB Tech Support as a Search Engine
IB Tech Support as a Search Engine
Your search results are presented using MagnifyCategory tree on the left enable further filteringSelect Tabular View to see results as an Active Report
IB Tech Support as a Search Engine
Select Tabular View to see results as an Active Report
Thank You!
Questions?