Discussion Board for collaboration on QlikView Scripting.
I´m with a doubt about a "fiel update".
For example, I have a table:
LOAD * INLINE [ NAME, AGE JOHN, 20 BILL, 25 PAUL, 30];
LOAD * INLINE [ NAME, AGE BILL, 55];
As result, I want this:
What better way to do this ?
Go to Solution.
Applymap is your friend here I think:
Mapping LOAD * INLINE [ NAME, AGE BILL, 55];
LOAD NAME, applymap('CORRECT',NAME,AGE) as AGE;
Just one of multiple ways to do this. Add the following to the end of your script:
LOAD * RESIDENT CORRECT;
LOAD * RESIDENT AGES
WHERE NOT EXISTS(NAME);
DROP Table AGES;
RENAME Table CORRECTED_AGES TO AGES;
I can´t use Resident in this case because I have millions rows.
For this i need a function.
Nice one indeed.
Now its my friend hahaha
As a bonus: keep in mind that a PRECEDING LOAD uses resident tables as well. They're just not that visible.
As a 2nd bonus: ApplyMap is way faster than exists(), especially with lots of data.