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 have a report with a ton of fields and I need to add an option for the user to suppress zero or not. Sometimes they want to see zeros and sometimes they want to see blanks. It is a runtime choice.
Is there an on table setting for that that I am not aware of? Or do I need to use an amper for every single field one by one.. like
COMPUTE X/I6&sup where &sup is "S" or "". Obviously this will work.. but I am looking for a faster way.
Note that I am talking about actual 0 values. I cannot use on table set nodata. There is data and the actual value is 0.
Also, for reasons that I won't get into, I cannot simply use a different master file depending on the user's choice.
I think you've already come up with the only answer. The format of each fo the fields needs to be treated individually, so there isn't a way to change them all-at-once to a zero-suppress. Your &var on the format for each field is probably the only way to go. Sorry for the bad news, but I do like your idea. Hadn't thought of using the &var for modifying formats based on user preference.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
You could set &vars to be the actual fieldnames and include a Dialogue Manager loop to create all those COMPUTEs. This would save on code and not have to manually change anything except the &vars. Just an idea..
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
You should be able to change the print format in your report without having to compute a new field by stating the format after the field. This will not work on a BY field. TABLE FILE CAR SUM DEALER_COST/D12.2S END
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007
-DEFAULT &ZERO='N';
-SET &Z1=IF &ZERO EQ 'Y' THEN 'S' ELSE '';
DEFINE FILE XXX
FMAT1/A8='D12.2&Z1';
FMAT2/A8='D15.1&Z1';
...
and some others you need in the report
END
TABLE FILE CAR
SUM
SALES/FMAT1
SALES/FMAT2
BY COUNTRY
ACROSS MODEL
END
I'm not sure if table has zero values....
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
That is exactly what I did. But I had to do it for approx 750 differenct fields. I was wondering if there was a one line command I could use to alter every one all at once. Sort of like "on table supress all zeros". I have this in the end...
-SET &XXX=IF (bunch of conditions here) THEN 'MYFIELDNAME/P12&SUP_ZERO.EVAL' ELSE '';
where &SUP_ZERO is 'S' or ''.
Thx.
JodyeThis message has been edited. Last edited by: jodye,
You could let WF take the strain for you although it could be overkill. Just perform a CHECK FILE with the HOLD option and then parse the fields and formats -
-SET &DUMMY = &SupZero.(<Suppress Zeroes,S>,<Leading Zeroes, >).Zero Choice.;
CHECK FILE CAR HOLD
TABLE FILE HOLD
PRINT FORMAT
BY FIELDNAME
WHERE SEGNO EQ 5
ON TABLE SAVE
END
-RUN
TABLE FILE CAR
SUM
-READ SAVE &Fieldname.A66 &Format.A8
-REPEAT :Loop WHILE &IORETURN EQ 0;
-SET &Printfield = IF &Format LIKE 'D%' THEN TRUNCATE(&Fieldname)||'/'||TRUNCATE(&Format)||&SupZero
- ELSE TRUNCATE(&Fieldname)||'/'||&Format;
&Printfield
-READ SAVE &Fieldname.A66 &Format.A8
-:Loop
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
GRID=OFF, SIZE=9, $
ENDSTYLE
END
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
You may be able to do it in your stylesheet. This really doesn't suppress the zero, it just keeps it from showing up. The original -SET for &N is the first column that may contain zero. The COLOR should be your background color. It will work with HTML, PDF or EXL2K, but not with EXCEL (97).
However, if the report is printed, then the 0s will appear, which might not be desirable. And online, this acts like invisible ink. The user could highlight the white text (click and drag), and the 0s will appear.
Sean
------------------------------------------------------------------------ PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
Posts: 210 | Location: Ottawa | Registered: November 03, 2005
Frank: Took more like 6 mins. :-). I was going to do that all along, was just wondering whether there was an on table command.
Tony: Excellent idea. But you are right.. a bit overkill.
Pat: Nice idea.. but I needed the fields to be truly empty. Not just look empty.
In case people are wondering, the rationale behind this request is that some of our users want to see zeros in excel and some do not. The zero, obviously, has a huge effect on averages. Sometimes it is important to factor in the zero and sometimes it should be treated as an empty cell. Thanks again everyone.