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 am trying to use the last function for a numeric field. The following is the sample code:
-SET &ECHO=ALL; TABLE FILE CAR PRINT CAR.ORIGIN.COUNTRY COMPUTE A123/A20 = IF COUNTRY EQ LAST COUNTRY THEN '' ELSE COUNTRY; CAR.COMP.CAR COMPUTE DC/D20.2 = IF DEALER_COST EQ LAST DEALER_COST THEN '' ELSE DEALER_COST; CAR.BODY.RETAIL_COST ON TABLE NOTOTAL ON TABLE SET STYLE * ENDSTYLE END
The requirement is such that the users need no data if the previous numeric value is the same. (they dont want zero.. they want to see a blank field). I have also tried to set a variable to blank and call it in the compute/define, but I still get IF THEN ELSE syntax error.
Any suggestions will be welcome. Thanks for reading.This message has been edited. Last edited by: sumant,
WebFOCUS 7.7.02Windows Output Formats: Excel, HTML, PDF
You can't use '' for a blank in a numeric field, the field format has to be alphanumeric for that to work.
Try this:
SET NODATA = '' TABLE FILE CAR PRINT COUNTRY COMPUTE A123/A20 = IF COUNTRY EQ LAST COUNTRY THEN '' ELSE COUNTRY; CAR COMPUTE DC/D20.2 MISSING ON= IF DEALER_COST EQ LAST DEALER_COST THEN MISSING ELSE DEALER_COST; RETAIL_COST ON TABLE NOTOTAL ON TABLE SET STYLE * ENDSTYLE END
WF 7.6.11 Output: HTML, PDF, Excel
Posts: 123 | Location: UK | Registered: October 09, 2003
Thanks Tewy for the reply. It works fine for the CAR file but when I actually implement it in my code, it gives me a 8 digit garbage value instead of blank.
WebFOCUS 7.7.02Windows Output Formats: Excel, HTML, PDF
Then it has to do with your actual data type. Can we see your master file description for that field(assuming it is a field in a master file)? Also, is the field stored externally in a database? We may need to see that format as well...
WebFOCUS 7.7.03/8.0.08 Dev Studio 7.7.03/8.0.08 App Studio 8.0.08 Windows 7 ALL Outputs
Posts: 402 | Location: Upland, IN | Registered: June 08, 2012
As long as your data is in the correct order, how about suppressing the zero with a numeric display option - "S" for Zero suppress:
TABLE FILE CAR
PRINT
CAR.ORIGIN.COUNTRY
COMPUTE A123/A20 = IF COUNTRY EQ LAST COUNTRY THEN '' ELSE COUNTRY;
CAR.COMP.CAR
COMPUTE DC/D20.2S = IF DEALER_COST EQ LAST DEALER_COST THEN 0 ELSE DEALER_COST;
CAR.BODY.RETAIL_COST
ON TABLE NOTOTAL
END
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