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.
Hi, How do I filter out an entire record based on a particular value?
For example
TABLE FILE CAR
PRINT SEATS
BY CAR
END
I want to eliminate CAR's where SEATS EQ to 2. So Alpha Romeo has values of 4, 2 and 2. I don't want to see the entire record of Alpha Romeo, because one of the values is a 2. The end result should only show, AUDI, BMW, DATSUN, JENSEN, PEUGEOT and TOYOTA. Thank you.This message has been edited. Last edited by: nickz,
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
TABLE FILE CAR
PRINT
SEATS
BY CAR
ON TABLE HOLD AS TEST_1 FORMAT ALPHA
END
-RUN
TABLE FILE CAR
PRINT
SEATS AS 'FIL_COL'
BY CAR AS 'CAR_1'
WHERE SEATS EQ 2
ON TABLE HOLD AS TEST_2 FORMAT ALPHA
END
-RUN
JOIN CAR IN TEST_1 TO CAR_1 IN TEST_2 AS J2
TABLE FILE TEST_1
PRINT
CAR
SEATS
WHERE FIL_COL NE 2
END
-RUN
DEFINE FILE CAR
SEATFLAG/I1=IF SEATS EQ 2 THEN 1 ELSE 0;
END
TABLE FILE CAR
PRINT SEATS
SUM.SEATFLAG WITHIN CAR NOPRINT
BY CAR
WHERE TOTAL SEATFLAG EQ 0;
END
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015
It is true as Hallway indicates it can be done in one table request. However the WHERE TOTAL has the disadvantage of being performed by WebFocus, so all data is first transferred from the database to the Webfocus server. No problem with small datasets, but if you are dealing with large dataset it could be better to do in 2 passes:
TABLE FILE CAR
PRINT DST.CAR
WHERE SEATS EQ 2;
ON TABLE HOLD AS HLDSEATS2 FORMAT ALPHA
END
-RUN
TABLE FILE CAR
PRINT
CAR
SEATS
WHERE NOT CAR IN FILE HLDSEATS2;
END
-RUN
Or even better with subquery to leave everything to database:
TABLE FILE CAR
PRINT DST.CAR
WHERE SEATS EQ 2;
ON TABLE HOLD AS SQLSEATS2 FORMAT SQL_SCRIPT
END
-RUN
TABLE FILE CAR
PRINT
CAR
SEATS
WHERE NOT DB_INFILE(SQLSEATS2, CAR, CAR);
END
-RUN
-EXIT
Martin.
WebFocus 8206M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
MATCH
FILE CAR
PRINT SEATS
BY CAR
RUN
FILE CAR
BY CAR
WHERE SEATS EQ 2;
AFTER MATCH HOLD AS WHATEVER
OLD-NOT-NEW
END
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :