Download presentation
Presentation is loading. Please wait.
Published byEaster Park Modified over 9 years ago
1
Off To See The Wizards: The FOCWIZARDS FOCWIZARDS: Noreen Redden Art Greenhaus With help from FOCAL POINT Wizards Copyright 2011, Information Builders. Slide 1
2
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
3
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.
4
DivisionEmployee Salary Hire Date CE000000040 *****$62,500.00 Tuesday, May 1 1990 000000050*****$54,100.00Wednesday, March 15 1989 000000180*****$25,400.00Wednesday, December 5 1990 000000200****$115,000.00Monday, April 3 1989 000000240*****$33,300.00Wednesday, March 14 1990 000000250*****$25,000.00Friday, March 30 1990 000000260*****$49,500.00Tuesday, May 1 1990 000000290*****$40,900.00Wednesday, March 20 1991 000000360*****$43,000.00Wednesday, February 7 1990 000000390*****$45,000.00Wednesday, July 11 1990 Total Division ****$493,700.00 Changing Numeric Fields to Alpha What I need
5
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
6
DivisionEmployee Salary Hire Date CE000000040 *****$62,500.00 Tuesday, May 1 1990 000000050*****$54,100.00Wednesday, March 15 1989 000000180*****$25,400.00Wednesday, December 5 1990 000000200****$115,000.00Monday, April 3 1989 000000240*****$33,300.00Wednesday, March 14 1990 000000250*****$25,000.00Friday, March 30 1990 000000260*****$49,500.00Tuesday, May 1 1990 000000290*****$40,900.00Wednesday, March 20 1991 000000360*****$43,000.00Wednesday, February 7 1990 000000390*****$45,000.00Wednesday, July 11 1990 Total Division****$493,700.00 Changing Numeric Fields to Alpha FPRINT
7
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 100000);,$
8
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
9
PINSALARYHIRE DATE 000000020$62,500.001990-07-18 09,00,00 000000030$70,000.001990-04-11 09,00,00 000000040$62,500.001990-05-01 09,00,27 000000050$54,100.001989-03-15 09,00,10 000000060$55,500.001989-03-01 09,01,10 000000080$43,400.001991-02-13 09,00,47 000000090$33,000.001990-04-03 09,00,11 000000110$19,300.001990-05-09 09,01,39 000000120$49,500.001990-04-02 09,00,39 000000140$62,500.001989-05-10 09,00,38 000000150$40,900.001989-04-19 09,00,45 000000160$62,500.001990-09-12 09,01,35 000000170$30,800.001991-03-12 09,01,35 000000180$25,400.001990-12-05 09,00,46 000000190$39,000.001990-10-10 09,01,24 000000210$43,600.001991-01-07 09,00,33 Automatic Filter and Change Date Display
10
FISCALYR 20102011 DIV CORP2011/03/052011/07/12.2011/05/14.2011/06/04.2011/05/10.2011/05/16.2011/05/08.2011/11/07 NE2011/03/012011/05/09 2011/01/072011/05/10 2011/03/212011/10/10 2011/04/02. My Fiscal Year Begins on The First Business Day in May
11
Changing The Start of the Year Tip of the Hat to John Kutasz -SET &INDT=20110501; 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 20110502
12
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
13
FISCALYR 20102011 DIV CORP2011/03/052011/07/12.2011/05/14.2011/06/04.2011/05/10.2011/05/16.2011/05/08.2011/11/07 NE2011/03/012011/05/09 2011/01/072011/05/10 2011/03/212011/10/10 2011/04/02. My Fiscal Year Begins on The First Business Day in May
14
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
15
Report of GGSALES As of May 11, 2011 CategoryProductUnit SalesBudget UnitsdiffBudget vs Actual CoffeeCapuccino189217190370-1,153.001,153.00 Espresso308986311357-2,371.002,371.00 Latte878063884196-6,133.006,133.00 FoodBiscotti4213774193202,057.00 Croissant63005462998965.00 Scone3334143282555,159.00 GiftsCoffee Grinder186534186106428.00 Coffee Pot190695193028-2,333.002,333.00 Mug360570360632-62.0062.00 Thermos190081191241-1,160.001,160.00 TOTAL-5,503.005,503.00 Erase Negative From Your Mind
16
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
17
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'; $
18
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
19
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
20
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=0.500000, RIGHTMARGIN=0.500000, …
21
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
22
REPORT OF SALES AS OF MAY 10, 2011 FILTER: YEAR EQ '2011'; FILTER: CATEGORY EQ 'Coffee' OR 'Food' ; YEAR 2011 CategoryProduct CoffeeCapuccino1284710 Espresso1853343 Latte5505283 Total Category Coffee8643336 FoodBiscotti2387629 Croissant3976559 Scone2032570 Total Category Food8396758 Total17040094 Filter Information Dynamically in Report
23
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
24
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
25
GGSALES1 is in Sequence by SEQ_NO Multiple instances for each Region HISTORY is in Sequence by Region Historical RegionUnit SalesUnits Midwest903456343755 Northeast916675340951 Southeast935232359305 West932039348517 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
26
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
27
Copyright 2007, Information Builders. Slide 27 McGyver – How to Look at a Single Record Multiple Ways Copyright 2007, Information Builders. Slide 27 -WRITE FOCMCGYV X1234567890 -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
28
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
29
YEAR 201020112012 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
30
YEAR 201020112012 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
31
YEAR 201020112012 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
32
YEAR 201020112012 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
33
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.