VIN NAME DATE
Vin1 Test 1 2011-05-05
Vin1 Test 1 2011-05-10
Vin2 Test 2 2011-05-12
Vin3 Test 3 2011-05-01
Vin6 Test 6 2011-05-10
Vin7 Test 7 2011-05-02
Vin7 Test 7 2011-05-12
.
.
.
Table B
VIN NAME DATE FLAG
Vin1 Test 1 2011-05-05 1
Vin1 Test 1 2011-05-10 2
Vin2 Test 2 2011-05-12 1
Vin3 Test 3 2011-05-01 2
Vin6 Test 6 2011-05-10 1
Vin7 Test 7 2011-05-02 1
Vin7 Test 7 2011-05-12 2
.
.
.
Please, can someoe suggest how I can generate Table B from Table A? That is adding 1s and 2s for all records in the table.
ThanksThis message has been edited. Last edited by: Kerry,
WebFOCUS 7.7.02 Windows/SQL/CUBES HTML/PDF/XLS
May 23, 2011, 04:32 PM
Dan Satchell
As long as the data is already sorted by VIN, NAME, and DATE, this should be easy to do with a DEFINE or COMPUTE:
DEFINE FILE ....
FLAG/I2 = IF (VIN NE LAST VIN) OR (NAME NE LAST NAME) THEN 1 ELSE (LAST FLAG + 1);
END
WebFOCUS 7.7.05
May 24, 2011, 04:16 AM
umun
Thanks for your suggestion.
But when your logic is applied, it means whenever VIN EQ LAST VIN and NAME EQ LAST NAME, Flag is 2.
Please, how would first row (vin1) have flag =1 and the second(which is same with row 1) have Flag 2.