Off To See The Wizards: The FOCWIZARDS FOCWIZARDS: Noreen Redden Art Greenhaus With help from FOCAL POINT Wizards Copyright 2011, Information Builders. Slide 1
Copyright 2007, Information Builders. Slide 2 Alchemy Easy Changes to Make Golden Reports Potions Outputs the way you need them The Rabbit in the Hat McGyver Of Course Agenda
Copyright 2007, Information Builders. Slide 3 Alchemy How Do I Change a Numeric Field to Alpha, but still retain the ability to SUBTOTAL? Change a Filter to be Automatic? Change the definition of a Year so that it does not necessarily begin on January 1 st ? Display negative numbers as positive, but retain the value as negative for Subtotals, Styling, etc.
DivisionEmployee Salary Hire Date CE *****$62, Tuesday, May *****$54,100.00Wednesday, March *****$25,400.00Wednesday, December ****$115,000.00Monday, April *****$33,300.00Wednesday, March *****$25,000.00Friday, March *****$49,500.00Tuesday, May *****$40,900.00Wednesday, March *****$43,000.00Wednesday, February *****$45,000.00Wednesday, July Total Division ****$493, Changing Numeric Fields to Alpha What I need
Changing numeric fields to alpha but … EDIT, FTOA, PTOA, and now: FPRINT SET SUMMARYLINES=NEW DEFINE FILE EMPDATA BLNK/A1 = ' '; END TABLE FILE EMPDATA PRINT COMPUTE ASAL/A15 = STRREP(15, (FPRINT(SALARY,'D12.2M', 'A15')), 1, ' ', 1, '*', 15, ASAL); NOPRINT ASAL/R AS 'Salary' COMPUTE HIREDT1/A30 = FPRINT(HIREDATE,'wrMtrDYY','A30'); AS 'Hire Date' BY DIV AS 'Division' PAGE-BREAK BY BLNK NOPRINT RECOMPUTE ASAL AS 'Total Division' BY PIN AS 'Employee' ON TABLE RECOMPUTE ASAL AS 'Company Total' ON TABLE SET PAGE NOPAGE
DivisionEmployee Salary Hire Date CE *****$62, Tuesday, May *****$54,100.00Wednesday, March *****$25,400.00Wednesday, December ****$115,000.00Monday, April *****$33,300.00Wednesday, March *****$25,000.00Friday, March *****$49,500.00Tuesday, May *****$40,900.00Wednesday, March *****$43,000.00Wednesday, February *****$45,000.00Wednesday, July Total Division****$493, Changing Numeric Fields to Alpha FPRINT
Changing the Filter to Be Automatic FILENAME=EMPDATA, SUFFIX=FOC SEGNAME=EMPDATA, SEGTYPE=S1 FIELDNAME=PIN, ALIAS=ID, FORMAT=A9, INDEX=I, $ FIELDNAME=LASTNAME, ALIAS=LN, FORMAT=A15, $ FIELDNAME=FIRSTNAME, ALIAS=FN, FORMAT=A10, $ FIELDNAME=MIDINITIAL, ALIAS=MI, FORMAT=A1, $ … END DBA=DBA,$ USER=MGT,ACCESS=R,$ USER=' ',ACCESS=R,RESTRICT=VALUE_WHERE,NAME=SYSTEM, VALUE=DIV NE 'CORP' AND (TITLE OMITS 'VICE' OR SALARY LE );,$
Changing Display of Date-Time As Well With a Tip of the Hat to Francis Mariani TABLE FILE EMPDATA PRINT PIN SALARY COMPUTE TRANSDT2/A20 = CTRAN(20, (CTRAN(20, (FPRINT(TRANSDATE,'HYYMDS','A20')), BYTVAL('/','I2'), BYTVAL('-','I2'), 'A20')), BYTVAL(':','I2'),BYTVAL(',','I2'),'A20'); ON TABLE SET PAGE NOPAGE … NUMBER OF RECORDS IN TABLE= 32 LINES= 32 ACCESS LIMITED BY PASSWORD
PINSALARYHIRE DATE $62, ,00, $70, ,00, $62, ,00, $54, ,00, $55, ,01, $43, ,00, $33, ,00, $19, ,01, $49, ,00, $62, ,00, $40, ,00, $62, ,01, $30, ,01, $25, ,00, $39, ,01, $43, ,00,33 Automatic Filter and Change Date Display
FISCALYR DIV CORP2011/03/052011/07/ /05/ /06/ /05/ /05/ /05/ /11/07 NE2011/03/012011/05/ /01/072011/05/ /03/212011/10/ /04/02. My Fiscal Year Begins on The First Business Day in May
Changing The Start of the Year Tip of the Hat to John Kutasz -SET &INDT= ; DEFINE FUNCTION OUTBD/A8YYMD (INDT/A8) ST/A8YYMD = EDIT(INDT,'999999') | '01'; STSM/YYMD =DATECVT(ST,'A8YYMD','YYMD'); STBD/YYMD =DATEMOV(STSM,'BD+'); OUTBD/A8YYMD= DATECVT(STBD,'YYMD','A8YYMD'); END -RUN -SET &OUTBD2 = OUTBD(&INDT|'X'); -******************************************************* -SET &ST = EDIT(&INDT,'999999$$') | '01'; -SET &STSM=DATECVT(&ST,'I8YYMD','YYMD'); -SET &STBD=DATEMOV(&STSM,'BD+'); -SET &OUTBD = DATECVT(&STBD,'YYMD','I8YYMD'); -SET &OUTBD1= DATECVT( - (DATEMOV( - (DATECVT(&ST,'I8YYMD','YYMD')), - 'BD+')),'YYMD','I8YYMD'); -TYPE &OUTBD1displays
Changing The Start of the Year DEFINE FILE EMPDATA FISCALYR/YY = FIYR(HIRE_DATE,'D',&MM,&DD,'FYS ','YY'); END SET ACROSSPRT = COMPRESS TABLE FILE EMPDATA PRINT HIRE_DATE ACROSS FISCALYR BY DIV WHERE DIV EQ 'CORP' OR 'NE‘ END
FISCALYR DIV CORP2011/03/052011/07/ /05/ /06/ /05/ /05/ /05/ /11/07 NE2011/03/012011/05/ /01/072011/05/ /03/212011/10/ /04/02. My Fiscal Year Begins on The First Business Day in May
Erase Negative From Your Mind SET DROPBLNKLINE=ON TABLE FILE GGSALES SUM … COMPUTE diffA/D12.2A = UNITS – BUDUNITS; AS 'Budget vs Actual' BY 'GGSALES.SALES01.CATEGORY‘ SUMMARIZE diffA BY 'GGSALES.SALES01.PRODUCT' ON TABLE SET STYLE * … DEFMACRO=COND0002, MACTYPE=RULE, WHEN=N6 LT 0, $ TYPE=DATA, COLUMN=N6, COLOR='RED', MACRO=COND0002, $ ENDSTYLE END
Report of GGSALES As of May 11, 2011 CategoryProductUnit SalesBudget UnitsdiffBudget vs Actual CoffeeCapuccino , , Espresso , , Latte , , FoodBiscotti , Croissant Scone , GiftsCoffee Grinder Coffee Pot , , Mug Thermos , , TOTAL-5, , Erase Negative From Your Mind
Copyright 2007, Information Builders. Slide 16 Potions What Magic Wand Will Dynamically Generate and Prompt for Possible Filters (showing the expression) Show the Selected Filter(s) in the Report Heading, but no extra blank lines Create “flat” HOLD files without extra trailing blanks, and usable even if not in correct sort order Transform.mht files so I can use Templates
Ggsales1 MASTER FILENAME=GGSALES1, SUFFIX=FOC, $ SEGMENT=SALES01, SEGTYPE=S1, $ FIELDNAME=SEQ_NO, ALIAS=SEQ, USAGE=I5, TITLE='Sequence#', DESCRIPTION='Sequence number in database', $,,, DEFINE YEAR/A4 WITH SEQ_NO=EDIT( DATE,'9999'); $ FILTER NINETYSEVEN WITH SEQ_NO=YEAR EQ ‘2011'; $ FIELDNAME=UNITS, ALIAS=E10, USAGE=I8C, TITLE='Unit Sales', DESCRIPTION='Number of units sold', $ FIELDNAME=DOLLARS, ALIAS=E11, USAGE=I8C, TITLE='Dollar Sales', DESCRIPTION='Total dollar amount of reported sales', $ FIELDNAME=BUDUNITS, ALIAS=E12, USAGE=I08, TITLE='Budget Units', DESCRIPTION='Number of units budgeted', $ FIELDNAME=BUDDOLLARS, ALIAS=E13, USAGE=I08, TITLE='Budget Dollars', DESCRIPTION='Total sales quota in dollars', $ COMPUTE PCT_OF_BUDGET/F7.2%=UNITS/BUDUNITS * 100;, $ FILTER EAST WITH SEQ_NO=REGION EQ 'Northeast' OR 'Southeast'; $ FILTER FOODS WITH SEQ_NO=CATEGORY EQ 'Coffee' OR 'Food'; $
Copyright 2007, Information Builders. Slide 18 Dynamically Prompt for and Display Filters Copyright 2007, Information Builders. Slide 18 TABLE FILE SYSCOLUM WHERE TBNAME EQ '&FILENAME' PRINT XREMARKS AS 'DEFINITION' BY SHORTNAME AS 'FILTER_NAME' WHERE DEFINE EQ 'F' ON TABLE HOLD AS OUTPT1 FORMAT DFIX DELIMITER '|' END -RUN -SET &MAX = &LINES ; -REPEAT ENDLP FOR &I FROM 1 TO &MAX -READFILE OUTPT1 -SET &FLTRNME.&I= &FILTER_NAME; -SET &FILTERDEF.&I = SUBSTR(256,&DEFINITION,1,75,75,'A75'); -SET &SEL.&I = 'N'; -ENDLP
Copyright 2007, Information Builders. Slide 19 Filter Information Dynamically in Report Copyright 2007, Information Builders. Slide 19 -REPEAT ENDL2 FOR &I FROM 1 TO &MAX -SET &FILTERDF.&I = IF &SEL.&I EQ 'N' THEN ' ' ELSE - 'FILTER: ' | &FILTERDEF.&I; -ENDL2 TABLE FILE GGSALES1 HEADING "</2 REPORT OF SALES AS OF &DATEMTRDYY " -REPEAT ENDLP2 FOR &I FROM 1 TO &MAX -IF &SEL.&I NE 'Y' GOTO ENDLP2; "&FILTERDF.&I " -ENDLP2
Copyright 2007, Information Builders. Slide 20 Filter Information Dynamically in Report Copyright 2007, Information Builders. Slide 20 SUM DOLLARS ACROSS YEAR BY FILL AS '' BY CATEGORY BY PRODUCT -REPEAT ENDLP3 FOR &I FROM 1 TO &MAX -IF &SEL.&I NE 'Y' GOTO ENDLP3; WHERE &FLTRNME.&I -ENDLP3 ON CATEGORY SUBTOTAL AS 'Total Category' ON TABLE SUBTOTAL AS 'Total' ON TABLE HOLD AS OUTPT FORMAT PPT ON TABLE SET STYLE * $ INCLUDE = ENDEFLT, $ LEFTMARGIN= , RIGHTMARGIN= , …
Copyright 2007, Information Builders. Slide 21 Filter Information Dynamically in Report Copyright 2007, Information Builders. Slide 21 TABLE FILE GGSALES1 HEADING " REPORT OF SALES AS OF MAY 10, 2011 " "FILTER: YEAR EQ '2011'; " "FILTER: CATEGORY EQ 'Coffee' OR 'Food' ; " SUM DOLLARS ACROSS YEAR BY CATEGORY BY PRODUCT WHERE CURRENT WHERE FOODS ON CATEGORY SUBTOTAL … END
REPORT OF SALES AS OF MAY 10, 2011 FILTER: YEAR EQ '2011'; FILTER: CATEGORY EQ 'Coffee' OR 'Food' ; YEAR 2011 CategoryProduct CoffeeCapuccino Espresso Latte Total Category Coffee FoodBiscotti Croissant Scone Total Category Food Total Filter Information Dynamically in Report
WEBFOCUS Excel Templates Wizards Hat for Tony Alsford Companies Upgrading Office applications to Office 2007 Move away from macros Move away from formulae Single page Web archive (.mht document) Utilize Script of MS Excel (similar to VB Script) Create temporary MS EXCEL file in the temp folder Use –WRITE to create the procfile.vbs Execution opens an instance of EXCEL Activates required sheet, changes font, etc.; Adds formulae if required Saves as Excel 2003 compatible
JOIN to a Sequential File Doesn’t Work JOIN to a Sequential file requires Both files must be sorted in ASCENDING order Different Sort Orders? Many-to-many is not supported. (FOC1070) VALUE FOR JOIN 'FROM' FIELD OUT OF SEQUENCE. RETRIEVAL ENDED (FOC1071) VALUE FOR JOIN 'TO' FIELD OUT OF SEQUENCE. RETRIEVAL ENDED (FOC1072) DUPLICATES IN JOIN 'FROM' FIELD %1%2%3%4
GGSALES1 is in Sequence by SEQ_NO Multiple instances for each Region HISTORY is in Sequence by Region Historical RegionUnit SalesUnits Midwest Northeast Southeast West FOCUS Error Message 107x be gone JOIN REGION IN GGSALES1 TO MULTIPLE REGION IN HISTORY TAG J0 AS J0 END ENGINE INT CACHE SET ON TABLE FILE GGSALES1 SUM 'GGSALES1.SALES01.UNITS' 'AVE.J0.HISTORY.HISTUNITS' AS 'Historical,Units' BY 'GGSALES1.SALES01.REGION‘ END
Copyright 2007, Information Builders. Slide 26 The Rabbit In the Hat -- McGyver How Do I Use ACROSS Year, but show different verb objects for each across value List Details sorted within several different Dimensions Subtotals of each value in the lower Dimension
Copyright 2007, Information Builders. Slide 27 McGyver – How to Look at a Single Record Multiple Ways Copyright 2007, Information Builders. Slide 27 -WRITE FOCMCGYV X RUN JOIN CONTROL WITH SEQ_NO IN GGSALES1 TO CONTROL IN FOCMCGYV AS AJ -RUN -STEP2 DEFINE FILE GGSALES1 CONTROL/A1 WITH SEQ_NO = 'X'; AOUNTER/I1 = (COUNTER +1) /2; BOUNTER/I1 = IMOD(COUNTER,2,'I1'); VO/I9C = IF AOUNTER EQ 1 THEN BUDDOLLARS ELSE IF AOUNTER EQ 2 THEN DOLLARS; VOTITL1/A6 = IF AOUNTER EQ 1 THEN 'BUDGET' ELSE IF AOUNTER EQ 2 THEN 'ACTUAL' ELSE ' '; BY2/A2 = IF BOUNTER EQ 0 THEN ST ELSE ' '; REGION/A11 = IF REGION EQ 'MIDWEST' THEN 'Midwest' ELSE REGION; BLNK/A1= ' '; END
Copyright 2007, Information Builders. Slide 28 Looking at a Single Record Multiple Ways Tip of the Hat to David Smith Copyright 2007, Information Builders. Slide 28 TABLE FILE GGSALES1 WHERE COUNTER LE 4 WHERE (YEAR EQ '&THISYR' AND AOUNTER LE 2) OR (YEAR EQ '&LSTYR' AND AOUNTER EQ 2) OR (YEAR EQ '&NXTYR' AND AOUNTER EQ 1) SUM VO AS '' ACROSS YEAR ACROSS AOUNTER NOPRINT ACROSS VOTITL1 AS '' BY REGION NOPRINT BY BOUNTER NOPRINT BY BLNK NOPRINT BY BY2 NOPRINT PAGE-BREAK BY PCD AS 'PCD' ON BY2 SUBHEAD "Region: <REGION State: <ST " WHEN BOUNTER EQ 0 ON BOUNTER SUBHEAD "Region Totals" WHEN BOUNTER EQ 1 ON BLNK SUBTOTAL AS 'Total' WHEN BOUNTER EQ 1
YEAR ACTUALBUDGETACTUALBUDGET PCD Region: Midwest State:IL C141254,848179,941165,591192,528 C142428,711557,990549,629597,026 F101337,553241,523257,516258,421 F102178,082200,326200,330214,343 F103253,080296,063296,286316,776 G100202,175186,456174,579199,495 G10472,619101,468115,282108,565 G11099,920144,534133,372154,647 G121106,801100,18998,027107,196 McGyver – How to Look at a Single Record Multiple Ways
YEAR ACTUALBUDGETACTUALBUDGET PCD Region: Midwest State:MO C141269,942142,901149,201152,898 C142448,590502,356518,391537,497 F101238,167228,746243,786244,747 F102175,008202,575193,069216,748 F103336,941276,585276,930295,934 G100181,146157,661162,706168,685 G104102,79091,43392,89697,829 G11093,09583,15888,47588,973 G12176,564117,256113,589125,457 McGyver – How to Look at a Single Record Multiple Ways
YEAR ACTUALBUDGETACTUALBUDGET PCD Region: Midwest State:TX C141297,990142,990157,375152,992 C142406,250536,972531,995574,538 F101252,353156,591166,045167,542 F102160,326166,363184,912177,999 F103262,012321,013325,875343,475 G100189,906192,668176,431206,143 G104101,23896,51893,081103,270 G110107,98297,14796,310103,940 G121107,749106,36697,148113,806 McGyver – How to Look at a Single Record Multiple Ways
YEAR ACTUALBUDGETACTUALBUDGET PCD Region Totals C141822,780465,832472,167498,418 C1421,283,5511,597,3181,600,0151,709,061 F101828,073626,860667,347670,710 F102513,416569,264578,311609,090 F103852,033893,661899,091956,185 G100573,227536,785513,716574,323 G104276,647289,419301,259309,664 G110300,997324,839318,157347,560 G121291,114323,811308,764346,459 Total5,741,8385,627,7895,658,8276,021,470 McGyver – How to Look at a Single Record Multiple Ways
More Tips from FOCAL POINT Wizards Large or multiple Compound Reports with NOBREAK By Warren Hinchliffe JavaScript to Validate Date Entry By Tom Flynn and Jeralee Seaburn, Converting and Shortening an Integer to Alphanumeric By Carl Fuglein, Tom Flynn, Gerard van der Paal, and John Lewis Open Drilldown in a New TabOpen Drilldown in a New Tab By Marilyn Patchen Beyer McGyver Dynamic Subtotals/SubFootsMcGyver Dynamic Subtotals/SubFoots by David Smith CTRAN Without PainCTRAN Without Pain by Francis Mariani WebFOCUS Excel TemplatesWebFOCUS Excel Templates by Tony Alsford WebFOCUS MetaDATEsWebFOCUS MetaDATEs by John Kutasz Column Title FormattingColumn Title Formatting By Warren Hinchliffe Conditional Graph Hover TextConditional Graph Hover Text By Warren Hinchliffe