“Ad hoc” Querying and Reporting with WebFOCUS Twanette Jurd 9 April 2010
My theory (or theories) ….
Technology is not the answer …. the result of applying the technology provides the answers. Point and Click, Drag and Drop, and an intuitive and “functionality-rich” interface may be the requirement for a good BI tool …. but a good BI application is one that provides a faster, easier way to get the information that is needed. Most users need applications, not tools
WebFOCUS has a number of really good ad hoc “tools” which users could use to build their own queries and reports. But is that really what users want or need? Will the broader user base use them? Furthermore, often data is simply too complex to simplify! And therefore we would not always be able to give users out-of-the-box tools to simply build their own queries and reports.
Perhaps the project team is envisioning a totally ad hoc environment, whereas business management is more interested in the delivery of standardized analysis? We need to make sure the BI implementation’s deliverable matches the business demand and expectations – obviously! Self-service parameter-driven reports allow users to easily retrieve what they want in the format that they need, with limited training
In support of my theory ….
Assumption that the average business user has the know-how or the time to use BI tools An end-user market that is flooded with misguided hype from the vendor community, indicating that, “BI tools are for everyone” Users don’t have the time to work with a BI tool and navigate a data warehouse to produce the information they need
Ralph Kimball, an expert on data warehousing, says the following in his book, The Data Warehouse Toolkit; 2nd Edition: “The majority of the user base likely will access the data via pre-built parameter-driven analytic applications. Approximately 90 to 95 percent of the potential users will be served by these canned applications that are essentially finished templates that do not require users to construct relational queries directly.”
WebFOCUS does ad hoc …. very well !!
WebFOCUS isn’t just a tool – it is a complete toolbox Understand all the pieces: APP commands, SET commands CHECK FILE, USE JOIN, DEFINE, TABLE, GRAPH, MATCH MODIFY And especially: Dialogue Manager Don’t use a hammer to tighten the screw!
&variable Single ampersand (&) precedes variable name In effect throughout a single procedure &&variable Remain in effect throughout the FOCUS session Change with -SET &&variable Cleared by the LET CLEAR command In a non-persistent connection, set in edasprof, or controlled by IBIF_persistentamp setting &variable.&index Indexed variables Multiple selections for the same variable name
&variable names Each name from characters Case sensitive Variable values Variables may be from K in length Stored as alphanumeric values Interpreted as integer or alphanumeric based on usage SET DMPRECISION introduces decimal values
&DATEMM/DD/YY &DATEYYMDYYYY/MM/DD &YMDYYMMDD &DMYDDMMYY &MDYMMDDYY &TODHH.MM.SS &FOCFOCEXEC &FOCRELWebFOCUS release number …and many more, check the manual.
TABLE Command &LINES, &RECORDS, &BASEIO, &FOCERRNUM Operating System Command &RETCODE -READ &IORETURN Referencing a statistical variable implies –RUN Needs execution to get a value
EX focexec variable1=value1,variable2=value2 -DEFAULT -SET -READ -HTMLFORM
Table file car …. No parameters DEFINE FILE CAR GP_PCT/P7.2% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100 ; END TABLE FILE CAR HEADING "Car Catalog" PRINT COUNTRY CAR MODEL BODYTYPE SEATS DEALER_COST RETAIL_COST GP_PCT ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * -INCLUDE FPS_STYLE ENDSTYLE END DEFINE FILE CAR GP_PCT/P7.2% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100 ; END TABLE FILE CAR HEADING "Car Catalog" PRINT COUNTRY CAR MODEL BODYTYPE SEATS DEALER_COST RETAIL_COST GP_PCT ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * -INCLUDE FPS_STYLE ENDSTYLE END
Table file car …. No parameters DEFINE FILE CAR GP_PCT/P7.2% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100 ; END TABLE FILE CAR HEADING "Car Catalog" PRINT DEALER_COST BY COUNTRY BY CAR BY MODEL ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * -INCLUDE FPS_STYLE ENDSTYLE END DEFINE FILE CAR GP_PCT/P7.2% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100 ; END TABLE FILE CAR HEADING "Car Catalog" PRINT DEALER_COST BY COUNTRY BY CAR BY MODEL ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * -INCLUDE FPS_STYLE ENDSTYLE END
Table file car …. No parameters -DEFAULTH FP_COUNTRY = 'FOC_NONE' -SET &FP_COUNTRY_HDR = IF &FP_COUNTRY EQ 'FOC_NONE' THEN - 'All Countries' ELSE &FP_COUNTRY ; DEFINE FILE CAR GP_PCT/P7.2% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100 ; END TABLE FILE CAR HEADING "Car Catalog for &FP_COUNTRY_HDR " PRINT DEALER_COST BY COUNTRY BY CAR BY MODEL WHERE COUNTRY EQ '&FP_COUNTRY' ; ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * -INCLUDE FPS_STYLE ENDSTYLE END -DEFAULTH FP_COUNTRY = 'FOC_NONE' -SET &FP_COUNTRY_HDR = IF &FP_COUNTRY EQ 'FOC_NONE' THEN - 'All Countries' ELSE &FP_COUNTRY ; DEFINE FILE CAR GP_PCT/P7.2% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100 ; END TABLE FILE CAR HEADING "Car Catalog for &FP_COUNTRY_HDR " PRINT DEALER_COST BY COUNTRY BY CAR BY MODEL WHERE COUNTRY EQ '&FP_COUNTRY' ; ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * -INCLUDE FPS_STYLE ENDSTYLE END &FP_COUNTRY = 'ENGLAND'
Table file car …. No parameters -DEFAULTH FP_BYFIELD = 'FOC_NONE' DEFINE FILE CAR GP_PCT/P7.2% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100 ; END TABLE FILE CAR HEADING "Car Catalog for &FP_COUNTRY_HDR " PRINT DEALER_COST BY &FP_BYFIELD NOPRINT BY COUNTRY BY CAR BY MODEL WHERE COUNTRY EQ '&FP_COUNTRY' ; ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * -INCLUDE FPS_STYLE ENDSTYLE END -DEFAULTH FP_BYFIELD = 'FOC_NONE' DEFINE FILE CAR GP_PCT/P7.2% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100 ; END TABLE FILE CAR HEADING "Car Catalog for &FP_COUNTRY_HDR " PRINT DEALER_COST BY &FP_BYFIELD NOPRINT BY COUNTRY BY CAR BY MODEL WHERE COUNTRY EQ '&FP_COUNTRY' ; ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * -INCLUDE FPS_STYLE ENDSTYLE END &FP_BYFIELD = 'HIGHEST DEALER_COST'
Table file car …. No parameters -DEFAULTH FP_PRINTFIELD = 'DEALER_COST' DEFINE FILE CAR GP_PCT/P7.2% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100 ; END TABLE FILE CAR HEADING "Car Catalog for &FP_COUNTRY_HDR " PRINT &FP_PRINTFIELD BY &FP_BYFIELD NOPRINT BY COUNTRY BY CAR BY MODEL WHERE COUNTRY EQ '&FP_COUNTRY' ; ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * -INCLUDE FPS_STYLE ENDSTYLE END -DEFAULTH FP_PRINTFIELD = 'DEALER_COST' DEFINE FILE CAR GP_PCT/P7.2% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100 ; END TABLE FILE CAR HEADING "Car Catalog for &FP_COUNTRY_HDR " PRINT &FP_PRINTFIELD BY &FP_BYFIELD NOPRINT BY COUNTRY BY CAR BY MODEL WHERE COUNTRY EQ '&FP_COUNTRY' ; ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * -INCLUDE FPS_STYLE ENDSTYLE END &FP_PRINTFIELD = ‘GP_PCT'
Table file car …. No parameters -SET &FP_PRINTFIELD = 'DEALER_COST' ; -SET &FP_COUNTRY = 'ENGLAND' ; -SET &FP_BYFIELD = 'SEATS' ; DEFINE FILE CAR GP_PCT/P7.2% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100 ; END TABLE FILE CAR HEADING "Car Catalog for &FP_COUNTRY_HDR " PRINT &FP_PRINTFIELD BY &FP_BYFIELD NOPRINT BY COUNTRY BY CAR BY MODEL WHERE COUNTRY EQ '&FP_COUNTRY' ; ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * -INCLUDE FPS_STYLE ENDSTYLE END -SET &FP_PRINTFIELD = 'DEALER_COST' ; -SET &FP_COUNTRY = 'ENGLAND' ; -SET &FP_BYFIELD = 'SEATS' ; DEFINE FILE CAR GP_PCT/P7.2% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100 ; END TABLE FILE CAR HEADING "Car Catalog for &FP_COUNTRY_HDR " PRINT &FP_PRINTFIELD BY &FP_BYFIELD NOPRINT BY COUNTRY BY CAR BY MODEL WHERE COUNTRY EQ '&FP_COUNTRY' ; ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * -INCLUDE FPS_STYLE ENDSTYLE END
Standards: File names (fexes, masters, stylesheets etc.) Amper variable (parameter) names Program labels Report / output formats Styles and stylesheets Program Headers / Documentation Re-usable / generic code stored in “-INCLUDE” files Parameter forms / screens: Consistent layout Logical flow Ability to save reports variants (i.e. save parameters) Navigation: Consistent Logical Fast navigation: “favorites” and “search” functionality
Manage Report Variants “Favorites” for fast navigation Ability to search for Menu Options
Context menu per menu option
Parameterise selections / filters
Parameterise “measure” i.e. which “SUM” field
Parameterise grouping, sort order and navigation
Parameterise report and graph format
Parameterise output destination
Parameter-driven reporting templates sharing a standard "look-and-feel", significantly reducing the end-user learning curve for receiving information Standardised look and feel for each report selection and display output Enablement of meaningful analysis with detailed drill- down to any desired depth Enhanced flexibility to consider multiple scenarios, enabled by powerful parametric functionality And with WebFOCUS …. You can do it too!