[SOLVED] How To Recognize The First Occurrence of a Field Value
Hello All,
This there a way in the Define section to recognize the first occurrence of a field value. For example: Selectval/A1 = IF FST.ACCOUNT_NUMBER EQ '123' THEN 'Y' ELSE 'N';
Thanks to all, Ken Z/OC FOCUS 7.6.5This message has been edited. Last edited by: Kerry,
October 05, 2010, 10:38 AM
Wep5622
I think you can do something like this:
DEFINE FILE CAR
FIRST/A1 = IF ACCOUNT_NUMBER NE LAST ACCOUNT NUMBER THEN 'Y' ELSE 'N';
END
The trick being that LAST refers to the previous row.
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 :
October 05, 2010, 04:37 PM
Waz
If you use Web5622 suggestion, the data must be presorted.
This shouldn't be an issue with an RDBMS, but care must be taken.