Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

pennetzdorfer
Contributor 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!

Tags (1)
4 Replies
giakoum
Honored Contributor II

Re: LOAD * and modify a certain field at the same time

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

pennetzdorfer
Contributor III

Re: LOAD * and modify a certain field at the same time

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
Honored Contributor II

Re: LOAD * and modify a certain field at the same time

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
Contributor III

Re: LOAD * and modify a certain field at the same time

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

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

Community Browser