Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pennetzdorfer
Creator III
Creator III

LOAD * and modify a certain field at the same time

Hey,

is there a neat way to LOAD * from a resident table and at the same time modify a certain field (without having to rename it)?

Example:

LOAD *, 
       if(peek(InvoiceNo) = InvoiceNo, 'cancelled', InvoiceNo) as InvoiceNo
resident Invoices order by InvoiceNo asc, date desc)

My attempt gives an error "Field names must be unique within table" ... which is obvious, as the field 'InvoiceNo' already exists in the resident table.

Thanks for your ideas!

4 Replies
giakoum
Partner - Master II
Partner - Master II

replace the star * with the remaining field names and it should work.

pennetzdorfer
Creator III
Creator III
Author

Thanks for your suggestion!

There are about 30 remaining fields - and in terms of keeping my script lean and "easy-care" I would prefer the star * ...

giakoum
Partner - Master II
Partner - Master II

Well then inner join it with itself or use a different field name, drop the original and rename the different to the original. Otherwise,.. I dont know!

pennetzdorfer
Creator III
Creator III
Author

Yes, that's how I handle it at the moment.

I was just asking myself if there was a shorter/neater solution. Thanks anyway!