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.
C3 is of type integer(I4). Is there any way to eliminate the 0's from the count column and replace it with blank. I have also tried changing the datatye to alpha(A4) but that appends 0's in the front of the count values (0002). Any suggestions:
Thnks RJThis message has been edited. Last edited by: Kerry,
SET HOLDLIST = PRINTONLY
TABLE FILE CAR
SUM
CNT.DST.SEATS
BY COUNTRY
ON TABLE HOLD AS H1
END
-*?FF H1
-*-EXIT
TABLE FILE CAR
BY COUNTRY
BY CAR
BY SEATS
ON TABLE HOLD AS H2
END
JOIN COUNTRY IN H1 TO MULTIPLE COUNTRY IN H2
-RUN
TABLE FILE H1
PRINT
COMPUTE CS/I4=IF COUNTRY NE LAST COUNTRY THEN H1.SEATS ELSE 0; AS 'Count Seats'
BY H1.COUNTRY AS 'Country'
BY H2.CAR AS 'Car'
BY H2.SEATS AS 'Seats'
BY H1.SEATS NOPRINT
END
This message has been edited. Last edited by: Ram Prasad E,
If you use the MISSING=ON method suggested above, you will need to add
ON TABLE SET NODATA ' '
to your final TABLE FILE to display the null values as blanks. The drawback is that this will affect all null values in all columns. An alternative is to format only your COMPUTEd column to suppress zeroes. The S in the format (I5S) in the code below replaces zeroes with blanks. Also, if your original table is sorted and/or keyed on column 1 (C1), you don't need the second hold file. You should be able to simply join back to the original table.
TABLE FILE CAR
COUNT DST.SEATS AS 'CNT_DST'
BY COUNTRY
ON TABLE HOLD AS H1
END
-*
JOIN CLEAR *
JOIN COUNTRY IN H1 TO ALL COUNTRY IN CAR AS J1
-*
TABLE FILE H1
PRINT
COMPUTE CNT_SEATS/I5S = IF COUNTRY NE LAST COUNTRY THEN H1.CNT_DST ELSE 0 ; AS 'C3'
BY H1.COUNTRY AS 'C1'
BY CAR.CAR AS 'C2'
END
This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
On the other hand, sometimes suppressing all zeroes in a column is not desirable because some of those zeroes may be valid. In that case, the MISSING=ON/SET NODATA method will allow you to display valid zeroes while suppressing others with blanks. For example, in the sample code below if the value of CNT_SEATS were zero for a particular value of C1, the zero value would display as zero for the first C1 row while other rows with the same C1 value would display as blanks.
TABLE FILE CAR
COUNT DST.SEATS AS 'CNT_DST'
BY COUNTRY
ON TABLE HOLD AS H1
END
-*
JOIN CLEAR *
JOIN COUNTRY IN H1 TO ALL COUNTRY IN CAR AS J1
-*
TABLE FILE H1
PRINT
COMPUTE CNT_SEATS/I5 MISSING ON = IF COUNTRY NE LAST COUNTRY THEN H1.CNT_DST ELSE MISSING ; AS 'C3'
BY H1.COUNTRY AS 'C1'
BY CAR.CAR AS 'C2'
ON TABLE SET NODATA ' '
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
But wait ... there's more. Just to prove that where there's a will there is almost always a way in WebFOCUS - by using the reformatting option when displaying columns, you can selectively format column C3 as either 'I5' or 'I5S':
TABLE FILE CAR
COUNT DST.SEATS AS 'CNT_DST'
BY COUNTRY
ON TABLE HOLD AS H1
END
-*
JOIN CLEAR *
JOIN COUNTRY IN H1 TO MULTIPLE COUNTRY IN CAR AS J1
-*
TABLE FILE H1
PRINT
COMPUTE C3FORMAT/A8 = IF COUNTRY NE LAST COUNTRY THEN 'I5' ELSE 'I5S' ; NOPRINT
COMPUTE CNT_SEATS/I5 = IF COUNTRY NE LAST COUNTRY THEN H1.CNT_DST ELSE 0 ; NOPRINT
CNT_SEATS/C3FORMAT AS 'C3'
BY H1.COUNTRY AS 'C1'
BY CAR.CAR AS 'C2'
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007