Things You Can Use on Monday Rob Palmer Solution Director Copyright 2010, Information Builders....
-
Upload
elijah-logan -
Category
Documents
-
view
217 -
download
1
Transcript of Things You Can Use on Monday Rob Palmer Solution Director Copyright 2010, Information Builders....
Things You Can Use on Monday
Rob PalmerSolution Director
Copyright 2010, Information Builders. Slide 1
Things You Can Use on Monday
Agenda
SET ParametersDialogue ManagerReportingFunctionsMissing DataApp CommandsTroubleshooting
Copyright 2010, Information Builders. Slide 2
SET Parameters
Copyright 2010, Information Builders. Slide 3
SET Parameters
A few of my favourite SET parameters
CENT-ZERO
CURRSYMB
COUNTWIDTH
DIRECTHOLD
DUPLICATECOL
BYDISPLAY
Copyright 2010, Information Builders. Slide 4
DMPRECISION
TARGETFRAME
ACROSSPRT
ASNAMES
HOLDLIST
HOLDATTR
SET Parameters – CENT-ZERO
Controls the display of the 0 to the left of the decimalOptions: ON, OFFDefault: OFF
Copyright 2010, Information Builders. Slide 5
SET CENT-ZERO = OFF SET CENT-ZERO = ON
SET Parameters – CURRSYMB
Controls the currency symbol printed with M and N formatsOptions: character, USD, GBP, JPY, EUR, NIS Default: $
SET CURRSYMB = $
SET CURRSYMB = GBP
SET CURRSYMB = EUR
SET Parameters – COUNTWIDTH
Controls the format size of COUNT columnsOptions: ON (9), OFF (5)Default: OFF
SET COUNTWIDTH = OFF SET COUNTWIDTH = ON
SET Parameters – DIRECTHOLD
Controls how HOLD FORMAT FOCUS files are loadedOptions: ON (directly), OFF (hold file and Modify)Default: ON
SET DIRECTHOLD = ON
READS = 54
SET DIRECTHOLD = OFF
READS = 108
SET Parameters – DUPLICATECOL
Controls how outer verb totals are displayedOptions: ON (show as separate column
OFF (show in same column)Default: ON
SET DUPLICATECOL = ON SET DUPLICATECOL = OFF
SUM SALESSUM SALES BY COUNTRY
SET Parameters – BYDISPLAY
Controls how BY fields are printedOptions: ON, OFFDefault: OFF
SET BYDISPLAY = OFF SET BYDISPLAY= ON
Excel rows
SET Parameters – BYDISPLAY
Controls how BY fields are printedOptions: ON, OFFDefault: OFF
SET BYDISPLAY= ONSET BYDISPLAY = OFF
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 = OFF
TEST = 128.88&TEST = 128
SET DMPRECISION = 1
&TEST = 128.9
SET DMPRECISION = 2
&TEST = 128.88
SET Parameters – TARGETFRAME
Controls target frame for drilldown displayOptions: framenameDefault: current framenameExplicit “TARGET=” in drilldown overrides this setting
No Setting
SET Parameters – TARGETFRAME
SET TARGETFRAME = _blankNo Setting
Controls target frame for drilldown displayOptions: framenameDefault: current framenameExplicit “TARGET=” in drilldown overrides this setting
SET Parameters – ACROSSPRT
Compress rows in report using PRINT and ACROSSOptions: NORMAL, COMPRESSDefault: NORMAL
SET ACROSSPRT= NORMAL SET ACROSSPRT= COMPRESS
SET Parameters – ACROSSPRT (cont)
SET ACROSSPRT = NORMAL
SET ACROSSPRT = COMPRESS
4 rows
Compressedto 2 rows
SET Parameters – ASNAMES, HOLDLIST, HOLDATTR
Affect contents of hold files and MFDs
ASNAMES (enables AS names to be used as column names)
Options: ON, OFF, FOCUS Default: FOCUS
HOLDLIST (keeps non-printed columns out of hold file)
Options: ALL, PRINTONLY, ALLKEYS Default: ALL
HOLDATTR (carries field attributes into the hold file)
Options: ON, OFF Default: OFF
SET Parameters – ASNAMES etc. (cont)
All defaulted
SET ASNAMES = ON – AS ‘UTILIZATION’ becomes fieldnameSET HOLDLIST = PRINTONLY – non-printed columns excludedSET HOLDATTR = ON – TITLEs from original MFD carried forward
SET ASNAMES = OFF
Affects fieldnames of ACROSS columns
SET Parameters – ASNAMES and ACROSS
TABLE FILE CARSUM SALESBY COUNTRYACROSS BODYTYPEON TABLE HOLDEND
SET ASNAMES = ON
SET Parameters
We will look at a few other SET parameters but later in the context of how they are used XRETRIEVAL HOLDMISS HNODATA NODATA
Dialogue Manager
Copyright 2010, Information Builders. Slide 21
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
Dialogue Manager – Some system variables
&FOCMODE Returns the operating system you are running in Enables you to take action based on where you are Values: WINNT, UNIX, etc.
&APPROOT Returns the approot directory You can test on it You can also parse it apart
&FOCFEXNAME Returns the name of the currently running Focexec You can pass this along and know who called “me”
Dialogue Manager – Subscripted & variables
& variables can be numerically subscripted If we have &TEST, no problem, we refer to &TESTBut what if we want &TEST1, &TEST2 … &TESTnMaybe we are loopingWe can create and use &TEST.&n where n is an integer
-REPEAT VAR_LOOP FOR &I FROM 1 TO 10-SET &TEST.&I='This is variable ' | &I;-VAR_LOOP-? &
Reporting
Copyright 2010, Information Builders. Slide 25
Reporting
TABLEF and RDBMSConditional JoinsDynamic Formatting
Reporting – TABLEF and RDBMS
WebFOCUS can sort and RDBMS can sortMake sure one does and make sure both don’tVerify that RDBMS is sorting
SQL TRACE ? STATS
AGGREGATION DONE …
Reporting – TABLEF and RDBMS (cont)
If RDBMS sorts your request, change TABLE to TABLEFTABLEF
No sorting done by WebFOCUS No Internal Matrix created Report written faster
Some reporting commands require TABLE Watch for errors and warnings
Use TABLEF whenever possible May improve performance dramatically Verify using traces and “? STAT”
Reporting – Conditional Joins
Joins do not have to be based on equality testsAll relational tests are available
JOIN … WHERE … NE JOIN … WHERE … GT JOIN … WHERE … LT etc.
Reporting – Conditional Joins (cont)
In JOIN tool select the JOIN and “Create/Edit Selection”
You will be presented with a familiar panelThe Where Expression Builder
The expression will be EQ by defaultAmend as required I changed it to GT
Reporting – Conditional Joins (cont)
We now JOIN based on a GT test
The WHERE clause will show up in your SQL
JOIN FILE PORTFOLIO_BASE AT PORTFOLIO_BASE.PORTFOLIO.SIC_CODE TO MULTIPLE FILE INDUSTRY AT INDUSTRY.INDUSTRY.SIC_CODE TAG J0 AS J0 WHERE PORTFOLIO_BASE.PORTFOLIO.SIC_CODE
GT J0.INDUSTRY.SIC_CODE; END
Reporting – Conditional Joins (cont)
Reporting – Dynamic Formatting
By default every value in a column is formatted the same I5, D12.2, A10 …
But what if the rows require different formatsSome may be dollars, percents, units, etc.Format each row’s value differentlyCreate a business rule to set each row’s format
Reporting – Dynamic Formatting (cont)
TABLE FILE METRICSSUM COMPUTE FLDFMT/A8 = DECODE METRIC('Revenue' 'D12Mb 'Units' 'D12.2' 'Margin' 'D12.1%' 'Bonus' 'D12.2M'); NOPRINTVALUE/FLDFMTBY METRICEND
Calculate the format with a COMPUTEReformat the measure referencing the computed column
Reporting – Dynamic Formatting (cont)
Run the reportEvery row gets the appropriate format
COMPUTE FLDFMT/A8 = DECODE METRIC('Revenue' 'D12M' 'Units' 'D12.2' 'Margin' 'D12.1%' 'Bonus' 'D12.2M'); NOPRINTVALUE/FLDFMT
Functions
Copyright 2010, Information Builders. Slide 36
Functions
A few of my favourite functions STRIP STRREP DB_LOOKUP PUTDDREC
Functions - STRIP
Removes a character from a stringSTRIP(length, string, char, outfield)
PHONE_DIGITS/A10 = STRIP(12, PHONE, '-', 'A10');
Functions - STRREP
Replace all instances of a string with another stringSTRREP (inlength, instring, searchlength, searchstring,
replength, repstring, outlength, outstring)
CITY_SHORT/A35 = STRREP (35, CITY, 13, 'United States', 2, 'US', 35, 'A35');
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);
Write data to a flat fileExecuted as part of a calculationPUTDDREC(ddname, dd_len, record_string, record_len,
outfield)
Functions – PUTDDREC
APP FI WRITEOUT DISK summit_work/writeout.txtTABLE FILE CARSUM SALESCOMPUTE TEXT/A52='Sales for ' | CAR | ' in ' | COUNTRY | ' were ' |
EDIT(SALES);COMPUTE WRITE_TEXT/I1=PUTDDREC('WRITEOUT', 8, TEXT, 52, 'I1'); NOPRINTBY COUNTRYBY CAREND
Functions – PUTDDREC (cont)
COMPUTE WRITE_TEXT/I1=PUTDDREC('WRITEOUT', 8, TEXT, 52, 'I1'); NOPRINT
Functions – DB_LOOKUP and PUTDDREC
COMPUTE WRITE_TEXT/I1=IF REGION EQ 'HR' THEN PUTDDREC('Sales Data N/A', 8, TEXT, 52, 'I1') ELSEPUTDDREC('WRITEOUT', 8, TEXT, 52, 'I1'); NOPRINT
MANAGER/A10 = IF SALES LT 100000 THEN DB_LOOKUP(FINANCE, REGION, REGION, SALES_MANAGER) ELSE ' ';
Both functions are executed as part of a calculationCan be conditionally execute based on IF–THEN–ELSE logicYou decide exactly when and what is doneBased on your test and your data at run time
Missing Data
Copyright 2010, Information Builders. Slide 44
Missing Data
Missing data in WebFOCUS can refer to: Missing data values or nulls Missing data segments
We will be looking at ways to handle missing values In calculations In HOLD files On report output
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
Missing Data – In HOLD files
If source data contains nulls, nulls will move to HOLD files Common with RDBMS data
What happens if MISSING data created by the report
TABLE FILE CARSUM SALESBY COUNTRYACROSS BODYTYPEON TABLE HOLDEND
Missing Data – In HOLD files (cont)
HOLDMISS Enables created MISSING data to be held as missing Options: ON, OFF Default: OFF
TABLE FILE CARACROSS BODYTYPEON TABLE HOLDEND
SET HOLDMISS = ON
Missing Data – HNODATA vs. NODATA
NODATA Controls characters printed for missing values Options: character string Default: .
HNODATA Controls characters held for missing alpha values Options: character string Default: . Note: If set, numeric missing values held as blank
Missing Data – HNODATA vs. NODATA (cont)
SET NODATA = ‘N/A’
SET HNODATA = ‘N/A’
Report Hold File
APP Commands
Copyright 2010, Information Builders. Slide 52
APP Commands
APP commands enable us to work with the applicationnamespace Control the use of files in the path Manipulate the path Interrogate the path Interrogate the application folders
Operating System agnostic Works the same everywhere
APP Commands – Control and use files
APP HOLD appname Directs all hold files to a specific app directory
APP HOLD summit_workAll hold files and their MFDs go to summit_work
APP HOLDMETA appname Directs only the hold file MFDs to a specific app directory
APP HOLDMETA summit_workMFDs go to summit_work, data goes to temp
APP HOLDDATA appname Directs only the hold data file to a specific app directory
APP HOLDDATA summit_workData goes to summit_work, MFDs go to temp
If the files exists, you may need to filedef itFILEDEF and DYNAM are operating system specificAPP FI is operating system agnosticAPP FI holdname DISK appname/filename.extWorks on all platforms
Can also be used in Master Files to specify the data file DATASET=‘appname/filename.ext’
APP Commands – Control and use files (cont)
APP FI WRITEOUT DISK summit_work/writeout.txt
FILE=GLACCOUNT ,SUFFIX=FIX,DATASET='ibisamp/glaccount.ftm'
APP Commands – Manipulate the Path
Change the path on the flyAPP PREPENDPATH adds your app to the front of the pathAPP APPENDPATH adds your app to the end of the pathApplies to the current process onlyAllows you to bring app folders into the path temporarily
summit_work is now the first app folder in the path
summit_work is now the last app folder in the path
APP PREPENDPATH summit_work
APP APPENDPATH summit_work
APP Commands – Manipulate the Path (cont)
By default APP folders are subdirectories of APPROOTAPP MAP allows you to assign a logical app name to any
available physical directoryCan be placed in the profiles or dynamic in a FocexecAPP MAP appname physicalnameCan be used like any other available APP folder
Hold to it, put it in the path, etc.
APP MAP share \\robpalmer\shareAPP MAP summit_temp c:\temp\summit_temp
APP Commands – Interrogate the Path
APP SHOW PATH Shows you the path
Notice the two we just APP MAPpedYou see it, but you can’t act on it Let’s act on it
APP Commands – Interrogate the app folders
APP LIST [HOLD] Lists all real and mapped application
foldersHOLD option creates focappl
APP LIST HOLDTABLE FILE focapplPRINT *END
APP Commands – Interrogate the app folders (cont)
APP QUERY appname [HOLD] Lists contents of selected applicationHOLD option creates focappq
APP QUERY summit_work HOLDTABLE FILE focappqPRINT *END
Troubleshooting
Copyright 2010, Information Builders. Slide 61
Troubleshooting
Leave a trailSQL Traces, XRETRIEVAL&ECHO, &STACKWHENCE IB Tech Support as a Search Engine
Troubleshooting – Leave a trail
Hansel and GretelWhen debugging, leave a trail -*@@Can find your changes later and remove them
Troubleshooting – SQL Traces
Have a Focexec handy to quickly turn on SQL traces
-INCLUDE trace
SET TRACEOFF=ALLSET TRACEON=SQLAGGR//CLIENTSET TRACEON=STMTRACE//CLIENTSET TRACEUSER=CLIENT
trace.fex
Troubleshooting – XRETRIEVAL
Controls whether WebFOCUS communicates with thedatabase Options: ON, OFF Default: ON
-INCLUDE traceTABLE FILE PORTFOLIOSUM AUTHORIZEDBY MONTHON TABLE HOLDEND
SET XRETRIEVAL = ON
SET XRETRIEVAL = OFF
Troubleshooting - &ECHO, &STACK
&ECHO Traces WebFOCUS commands Options: ON, ALL, OFF Default: OFF
&STACK Controls whether FOCSTACK is executed or not FOCSTACK is the command execution stack FOCSTACK does not contain Dialogue Manager
commands Options: ON, OFF Default: ON
Troubleshooting - &ECHO, &STACK (cont)
Used together they provide a valuable techniqueUse &ECHO to see WebFOCUS tracesUse &STACK to disable execution of the command stackEnables troubleshooting of:
Dialogue manager logic Execution flow Variable resolution
Does not incur cost of report executionTraces available in HTML source
To trace the command stack only
Show all WebFOCUS commandsTABLE, GRAPH, MATCH, JOIN etc.,Show the resolved values of all & variables
Does not show any Dialogue Manager commandsDoes not execute the command stack
Troubleshooting - &ECHO, &STACK (cont)
-SET &ECHO = ON;-SET &STACK = OFF;
To trace Dialogue Manager and the command stack
Show all WebFOCUS commandsTABLE, GRAPH, MATCH, JOIN etc.,Show the resolved values of all & variablesShows all Dialogue Manager commandsShows navigation and process flow
Does not execute the command stack
Troubleshooting - &ECHO, &STACK (cont)
-SET &ECHO = ALL;-SET &STACK = OFF;
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
Set up Tech Support as Search Engine for your browser In IE8, click Search Options dropdown (upper right)
Select Find More Providers…
Scroll to the bottom and select “Create your own Search Provider”
You will be presented with the following form
IB Tech Support as a Search Engine
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
Press Install Search Provider
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 MagnifyA maximum of 1000 results will be returnedCategory 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!
Come back next year for:
More Things You Can Use on Monday
or
Things You Can Use on Tuesday
I haven’t decided yet!!