Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
i need to create a for loop to run through a column of my QVD (ITEM_ID) for all records that have an 'A' at the end of the ITEM_ID, then i need to copy these records to the end of the QVD table and populate the FLAG column with a '1'. so the last 2 records below would need repeated only with the FLAG column also populated. does anyone have an idea of how i go about this?
table looks similar to:
ITEM_ID | FLAG | AMOUNT
----------------------------------
132 | | 8
132A | | 12
89A | | 5
TIA
Hi,
I don't think you need anything as complicated as a loop. Try;
data:
LOAD * INLINE [
ITEM_ID , FLAG , AMOUNT
132,,8
132A,,12
89A,,5
];
load
ITEM_ID,
1 AS FLAG,
AMOUNT
resident data
where right(ITEM_ID,1)='A';
Cheers,
Chris.