As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I'm stuck here because obviously WF doesn't know all the possible options since it is only examining the actual data. How would I go about this?
Thanks!
Edit: I ended up performing a new operation for each desired option. Also, I probably shouldn't have used years as an example since that was misleading.
E.g. Instead of TABLE FILE CARS COUNT MODEL AS 'COUNT' BY MANUFACTURER ON TABLE PCHOLD FORMAT HTML END
I used:
TABLE FILE CARS COUNT MODEL AS 'Ford' WHERE MANUFACTURER EQ 'FORD' ON TABLE PCHOLD FORMAT HTML ON TABLE SET EMPTYREPORT ANSI END
TABLE FILE CARS COUNT MODEL AS 'GM' WHERE MANUFACTURER EQ 'GM' ON TABLE PCHOLD FORMAT HTML ON TABLE SET EMPTYREPORT ANSI END
ect. for each option. It seems like there should be a better way to do this but I was able to make this work for our needs.This message has been edited. Last edited by: Donald Dille,
Donald
WebFOCUS 8.1.04 Windows Server, Win10 Excel, PDF, HTML
By finding or constructing a datasource that covers all the values, and using either JOIN or MATCH FILE to force inclusion of those rows in the result.
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
Another method would be to first determine the minimum and maximum years that you want in the report, then use Dialogue Manager to generate OVER statements to force the missing years. This runs if you have the IBI demo file GGORDER:
-SET &ECHO='ON';
SET HOLDLIST=PRINTONLY
SET NODATA=0
-RUN
TABLE FILE GGORDER
SUM
COMPUTE MIN_ORDER_YEAR1/YY = MIN.ORDER_DATE; NOPRINT
COMPUTE MAX_ORDER_YEAR1/YY = MAX.ORDER_DATE; NOPRINT
COMPUTE MIN_ORDER_YEAR/A4YY = MIN_ORDER_YEAR1;
COMPUTE MAX_ORDER_YEAR/A4YY = MAX_ORDER_YEAR1;
ON TABLE HOLD AS HYEARS
END
-RUN
-READ HYEARS &MIN_ORDER_YEAR.A4. &MAX_ORDER_YEAR.A4.
DEFINE FILE GGORDER
YEAR/YY = ORDER_DATE;
END
-RUN
TABLE FILE GGORDER
COUNT
PRODUCT_DESCRIPTION AS 'COUNT'
-*BY YEAR NOPRINT
FOR YEAR
'&MIN_ORDER_YEAR'
-SET &YEAR_REP = &MIN_ORDER_YEAR + 1;
-REPEAT END_REPEAT FOR &YEAR_REP FROM &YEAR_REP TO &MAX_ORDER_YEAR
OVER '&YEAR_REP'
-END_REPEAT
ON TABLE PCHOLD FORMAT HTML
END
-RUN
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
-* Get all CARs
TABLE FILE CAR
BY CAR
ON TABLE HOLD AS H_COUNTRY
END
-* Get all sales ( excluded JAPAN to simulate missing records )
TABLE FILE CAR
SUM CNT.SALES
BY CAR
WHERE COUNTRY NE 'JAPAN';
ON TABLE HOLD AS H_SALES
END
-* match it
MATCH FILE H_COUNTRY
BY CAR
RUN
FILE H_SALES
BY SALES
BY CAR
AFTER MATCH HOLD AS H_TOTAL OLD
END
-* display
TABLE FILE H_TOTAL
SUM SALES
BY CAR
END
You could choose to disable/enable HOLDMISS ( SET HOLDMISS = ON ) if you want MISSING as output instead of 0 for missing values.
G'luck, Dave
_____________________ WF: 8.0.0.9 > going 8.2.0.5
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010
-* File donald01.fex
JOIN BLANK WITH MODEL IN CAR TO BLANK IN FSEQ AS M_
DEFINE FILE CAR
BLANK/A1 WITH MODEL=' ';
YEAR/I4=DECODE COUNTRY(ENGLAND 2008 FRANCE 2010 ITALY 2013 JAPAN 2015 ELSE 2005);
YEARF/I4=2004 + ORDER;
END
TABLE FILE CAR
SUM
FST.YEAR FST.YEARF
COMPUTE CNTMODEL/I5=IF FST.YEAR EQ FST.YEARF THEN CNT.MODEL ELSE 0;
BY YEARF
BY YEAR
WHERE YEARF LE YEAR;
ON TABLE HOLD
END
TABLE FILE HOLD
SUM CNTMODEL
BY YEARF
END