Things You Can Use on Monday

78
Things You Can Use on Monday Rob Palmer Solution Director Copyright 2010, Information Builders. Slide 1

description

Things You Can Use on Monday. Rob Palmer Solution Director. Things You Can Use on Monday. Agenda SET Parameters Dialogue Manager Reporting Functions Missing Data App Commands Troubleshooting. SET Parameters. SET Parameters. A few of my favourite SET parameters CENT-ZERO CURRSYMB - PowerPoint PPT Presentation

Transcript of Things You Can Use on Monday

Title of Your Presentation

Things You Can Use on MondayRob PalmerSolution DirectorCopyright 2010, Information Builders. Slide 11Things You Can Use on MondayAgenda

SET ParametersDialogue ManagerReportingFunctionsMissing DataApp CommandsTroubleshootingCopyright 2010, Information Builders. Slide 2SET ParametersCopyright 2010, Information Builders. Slide 33SET ParametersA few of my favourite SET parameters

CENT-ZERO

CURRSYMB

COUNTWIDTH

DIRECTHOLD

DUPLICATECOL

BYDISPLAY

Copyright 2010, Information Builders. Slide 4DMPRECISION

TARGETFRAME

ACROSSPRT

ASNAMES

HOLDLIST

HOLDATTR

SET Parameters CENT-ZEROControls 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 = ONSET Parameters CURRSYMBControls the currency symbol printed with M and N formatsOptions:character, USD, GBP, JPY, EUR, NIS Default:$

SET CURRSYMB = $

SET CURRSYMB = GBP

SET CURRSYMB = EURSET Parameters COUNTWIDTHControls the format size of COUNT columnsOptions:ON (9), OFF (5)Default:OFF

SET COUNTWIDTH = OFF

SET COUNTWIDTH = ON

SET Parameters DIRECTHOLDControls how HOLD FORMAT FOCUS files are loadedOptions:ON (directly), OFF (hold file and Modify)Default: ON

SET DIRECTHOLD = ON

READS = 54SET DIRECTHOLD = OFF

READS = 108SET Parameters DUPLICATECOLControls how outer verb totals are displayedOptions:ON(show as separate columnOFF(show in same column)Default:ON

SET DUPLICATECOL = ON

SET DUPLICATECOL = OFF

SUM SALESSUM SALES BY COUNTRYSET Parameters BYDISPLAYControls how BY fields are printedOptions:ON, OFFDefault:OFF

SET BYDISPLAY = OFF

SET BYDISPLAY= ON

Excel rowsSET Parameters BYDISPLAYControls how BY fields are printedOptions:ON, OFFDefault:OFF

SET BYDISPLAY= ONSET BYDISPLAY = OFF

SET Parameters DMPRECISIONControls decimal precision of & variablesOptions:OFF, nDefault:OFFIf OFF, everything is an integerOtherwise, you decide

-SET &TEST = 123.45 + 5.43;-TYPE TEST = &TESTSET DMPRECISION = OFFTEST = 128.88&TEST = 128SET DMPRECISION = 1&TEST = 128.9SET DMPRECISION = 2&TEST = 128.88SET Parameters TARGETFRAMEControls target frame for drilldown displayOptions:framenameDefault:current framenameExplicit TARGET= in drilldown overrides this setting

No Setting

SET Parameters TARGETFRAMESET TARGETFRAME = _blankNo Setting

Controls target frame for drilldown displayOptions:framenameDefault:current framenameExplicit TARGET= in drilldown overrides this setting

SET Parameters ACROSSPRTCompress rows in report using PRINT and ACROSSOptions:NORMAL, COMPRESSDefault:NORMAL

SET ACROSSPRT= NORMAL

SET ACROSSPRT= COMPRESS

SET Parameters ACROSSPRT (cont)SET ACROSSPRT = NORMALSET ACROSSPRT = COMPRESS

4 rowsCompressedto 2 rowsSET Parameters ASNAMES, HOLDLIST, HOLDATTRAffect contents of hold files and MFDs

ASNAMES (enables AS names to be used as column names)Options:ON, OFF, FOCUSDefault:FOCUS

HOLDLIST (keeps non-printed columns out of hold file)Options:ALL, PRINTONLY, ALLKEYSDefault:ALL

HOLDATTR (carries field attributes into the hold file)Options:ON, OFFDefault:OFF

SET Parameters ASNAMES etc. (cont)

All defaultedSET ASNAMES= ON AS UTILIZATION becomes fieldnameSET HOLDLIST= PRINTONLY non-printed columns excludedSET HOLDATTR= ON TITLEs from original MFD carried forward

SET ASNAMES = OFFAffects fieldnames of ACROSS columns

SET Parameters ASNAMES and ACROSSTABLE FILE CARSUM SALESBY COUNTRYACROSS BODYTYPEON TABLE HOLDEND

SET ASNAMES = ONSET ParametersWe will look at a few other SET parameters but later in the context of how they are usedXRETRIEVALHOLDMISSHNODATANODATADialogue ManagerCopyright 2010, Information Builders. Slide 2121Dialogue Manager ASISIn 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&FOCMODEReturns the operating system you are running inEnables you to take action based on where you areValues: WINNT, UNIX, etc.&APPROOTReturns the approot directoryYou can test on itYou can also parse it apart&FOCFEXNAMEReturns the name of the currently running FocexecYou can pass this along and know who called me

Dialogue Manager Subscripted & variables& variables can be numerically subscriptedIf 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-? &

ReportingCopyright 2010, Information Builders. Slide 2525ReportingTABLEF and RDBMSConditional JoinsDynamic Formatting

Reporting TABLEF and RDBMSWebFOCUS can sort and RDBMS can sortMake sure one does and make sure both dontVerify that RDBMS is sortingSQL TRACE? STATS

AGGREGATION DONE Reporting TABLEF and RDBMS (cont)If RDBMS sorts your request, change TABLE to TABLEFTABLEFNo sorting done by WebFOCUSNo Internal Matrix createdReport written faster Some reporting commands require TABLEWatch for errors and warningsUse TABLEF whenever possibleMay improve performance dramaticallyVerify using traces and ? STAT

Reporting Conditional JoinsJoins do not have to be based on equality testsAll relational tests are availableJOIN WHERE NEJOIN WHERE GTJOIN WHERE LTetc.

Reporting Conditional Joins (cont)In JOIN tool select the JOIN and Create/Edit Selection

You will be presented with a familiar panelThe Where Expression BuilderThe expression will be EQ by defaultAmend as requiredI 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_CODEGT J0.INDUSTRY.SIC_CODE; ENDReporting Conditional Joins (cont)Reporting Dynamic FormattingBy default every value in a column is formatted the sameI5, D12.2, A10 But what if the rows require different formatsSome may be dollars, percents, units, etc.Format each rows value differentlyCreate a business rule to set each rows 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 METRICENDCalculate the format with a COMPUTEReformat the measure referencing the computed columnReporting Dynamic Formatting (cont)

Run the reportEvery row gets the appropriate formatCOMPUTE FLDFMT/A8 = DECODE METRIC('Revenue' 'D12M' 'Units' 'D12.2' 'Margin' 'D12.1%' 'Bonus' 'D12.2M'); NOPRINTVALUE/FLDFMTFunctionsCopyright 2010, Information Builders. Slide 3636FunctionsA few of my favourite functionsSTRIPSTRREPDB_LOOKUPPUTDDRECFunctions - STRIPRemoves a character from a stringSTRIP(length, string, char, outfield)

PHONE_DIGITS/A10 = STRIP(12, PHONE, '-', 'A10');

Functions - STRREPReplace 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 PUTDDRECAPP 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 CARENDFunctions PUTDDREC (cont)COMPUTE WRITE_TEXT/I1=PUTDDREC('WRITEOUT', 8, TEXT, 52, 'I1'); NOPRINT

Functions DB_LOOKUP and PUTDDRECCOMPUTE WRITE_TEXT/I1=IF REGION EQ 'HR' THEN PUTDDREC('Sales Data N/A', 8, TEXT, 52, 'I1') ELSEPUTDDREC('WRITEOUT', 8, TEXT, 52, 'I1'); NOPRINTMANAGER/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 IFTHENELSE logicYou decide exactly when and what is doneBased on your test and your data at run timeMissing DataCopyright 2010, Information Builders. Slide 4444Missing DataMissing data in WebFOCUS can refer to:Missing data values or nullsMissing data segments

We will be looking at ways to handle missing valuesIn calculationsIn HOLD filesOn report output

Missing Data In calculationsExample:

Sales in HR is missing but treated like 0 in the calculationIs this right?Results of calculations can be made missing based on availability of components

PROFIT/D12 = SALES COSTS; DepartmentSalesCostsProfitEast1009010HR.90-90West090-90Missing 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; DepartmentSalesCostsProfitEast1009010HR.90.West090-90Missing Data In HOLD filesIf source data contains nulls, nulls will move to HOLD filesCommon with RDBMS dataWhat happens if MISSING data created by the report

TABLE FILE CARSUM SALESBY COUNTRYACROSS BODYTYPEON TABLE HOLDEND

Missing Data In HOLD files (cont)HOLDMISSEnables created MISSING data to be held as missingOptions:ON, OFFDefault:OFF

TABLE FILE CARACROSS BODYTYPEON TABLE HOLDEND

SET HOLDMISS = ONMissing Data HNODATA vs. NODATANODATAControls characters printed for missing valuesOptions:character stringDefault:.

HNODATAControls characters held for missing alpha valuesOptions:character stringDefault:.Note: If set, numeric missing values held as blank

Missing Data HNODATA vs. NODATA (cont)

SET NODATA = N/ASET HNODATA = N/AReportHold File

APP CommandsCopyright 2010, Information Builders. Slide 5252APP CommandsAPP commands enable us to work with the applicationnamespaceControl the use of files in the pathManipulate the pathInterrogate the pathInterrogate the application foldersOperating System agnosticWorks the same everywhere

APP Commands Control and use filesAPP HOLD appnameDirects all hold files to a specific app directoryAPP HOLD summit_workAll hold files and their MFDs go to summit_workAPP HOLDMETA appnameDirects only the hold file MFDs to a specific app directoryAPP HOLDMETA summit_workMFDs go to summit_work, data goes to tempAPP HOLDDATA appnameDirects only the hold data file to a specific app directoryAPP 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 fileDATASET=appname/filename.ext

APP Commands Control and use files (cont)APP FI WRITEOUT DISK summit_work/writeout.txtFILE=GLACCOUNT ,SUFFIX=FIX,DATASET='ibisamp/glaccount.ftm'APP Commands Manipulate the PathChange 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_workAPP APPENDPATH summit_workAPP 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 folderHold to it, put it in the path, etc.

APP MAP share \\robpalmer\shareAPP MAP summit_temp c:\temp\summit_tempAPP Commands Interrogate the PathAPP SHOW PATHShows you the path

Notice the two we just APP MAPpedYou see it, but you cant act on itLets act on it

APP Commands Interrogate the app foldersAPP 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

TroubleshootingCopyright 2010, Information Builders. Slide 6161TroubleshootingLeave a trailSQL Traces, XRETRIEVAL&ECHO, &STACKWHENCEIB Tech Support as a Search Engine

Troubleshooting Leave a trailHansel and GretelWhen debugging, leave a trail-*@@Can find your changes later and remove them

Troubleshooting SQL TracesHave a Focexec handy to quickly turn on SQL traces

-INCLUDE trace

SET TRACEOFF=ALLSET TRACEON=SQLAGGR//CLIENTSET TRACEON=STMTRACE//CLIENTSET TRACEUSER=CLIENTtrace.fexTroubleshooting XRETRIEVALControls whether WebFOCUS communicates with thedatabaseOptions:ON, OFFDefault:ON

-INCLUDE traceTABLE FILE PORTFOLIOSUM AUTHORIZEDBY MONTHON TABLE HOLDENDSET XRETRIEVAL = ON

SET XRETRIEVAL = OFF

Troubleshooting - &ECHO, &STACK&ECHOTraces WebFOCUS commandsOptions:ON, ALL, OFFDefault:OFF

&STACKControls whether FOCSTACK is executed or notFOCSTACK is the command execution stackFOCSTACK does not contain Dialogue Manager commandsOptions:ON, OFFDefault: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 logicExecution flowVariable resolutionDoes 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 & variablesDoes 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 flowDoes not execute the command stack

Troubleshooting - &ECHO, &STACK (cont)-SET &ECHO= ALL;-SET &STACK= OFF;Troubleshooting WHENCEShows where a selected module is being pulled fromCan search for Focexecs, Master Files and Access FilesWHENCE focexec FOCEXECWHENCE masterfile MASTERWHENCE accessfile ACCESSReturns 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 EngineSet up Tech Support as Search Engine for your browserIn IE8, click Search Options dropdown (upper right)

Select Find More Providers

Scroll to the bottom and select Create your own Search ProviderYou 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 Libraryhttp://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 EnginePress Install Search Provider

IB Tech Support as a Search Engine

Press Add on the confirmation panel

Your all setClick on the Search Providers drop downIB 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 TuesdayI havent decided yet!!