Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello !
I'd like to reprocess a previously loaded table, that's it, replacing it with a new configuration of fields an records.
Say for example the following source code :
[CODE]
TEST:
LOAD
*
INLINE [
NAME_TEST ;DATE_TEST ;TIME_TEST; VALUE_TEST
MARY ;01/01/2008 ;00:12:14 ; 200
MARY ;01/02/2008 ;00:12:15 ; 200
ANN ;04/01/2008 ;15:12:25 ; 300
MARY ;01/01/2009 ;00:20:20 ; 210
JOHN ;31/12/2008 ;14:20:30 ; 100
] (DELIMITER IS ';');
REPLACE LOAD
*
,LEFT(NAME_TEST,2) AS NAME_PREFIX
RESIDENT TEST ;//WHERE NAME_TEST='MARY';
[/CODE]
Of course I could rewrite the original LOAD statement but this is not the case.
I also know the embeded or cascade LOAD syntax (preceding LOAD). Again, this is not the case.
I really need to REPLACE, later on the script , the TEST table. As if I could do the LOAD statement in several layers or steps.
The source code above compiles OK, that is, there's no syntax error. But there's a general script error on the execution.
What could be wrong ?
BTW, there's a tiny QVW that you can use to test it.
Thanks !
Hi Adriano, is that what you try to achieve?
Cheers, Lukas
TEST:
LOAD
*
INLINE [
NAME_TEST ;DATE_TEST ;TIME_TEST; VALUE_TEST
MARY ;01/01/2008 ;00:12:14 ; 200
MARY ;01/02/2008 ;00:12:15 ; 200
ANN ;04/01/2008 ;15:12:25 ; 300
MARY ;01/01/2009 ;00:20:20 ; 210
JOHN ;31/12/2008 ;14:20:30 ; 100
] (DELIMITER IS ';');
NOCONCATENATE
TEST2:
LOAD
*
,LEFT(NAME_TEST,2) AS NAME_PREFIX
RESIDENT TEST ;
DROP TABLE TEST;
Rename table TEST2 to TEST;
Hi Adriano, is that what you try to achieve?
Cheers, Lukas
TEST:
LOAD
*
INLINE [
NAME_TEST ;DATE_TEST ;TIME_TEST; VALUE_TEST
MARY ;01/01/2008 ;00:12:14 ; 200
MARY ;01/02/2008 ;00:12:15 ; 200
ANN ;04/01/2008 ;15:12:25 ; 300
MARY ;01/01/2009 ;00:20:20 ; 210
JOHN ;31/12/2008 ;14:20:30 ; 100
] (DELIMITER IS ';');
NOCONCATENATE
TEST2:
LOAD
*
,LEFT(NAME_TEST,2) AS NAME_PREFIX
RESIDENT TEST ;
DROP TABLE TEST;
Rename table TEST2 to TEST;
Thanks !
I understand your code can help me out.
However, I'd like to recover the original approach, which is to use the REPLACE/LOAD.
Someone else can explain us when REPLACE/LOAD is used ?
Thanks!
Hmmm. Well, I suspect that what's happening is that the REPLACE normally drops the original table first. When it sees you're loading from the original table, it probably just ignores the REPLACE, since otherwise it would be the same as dropping the table completely. I'm mostly guessing, and comparing what you did to doing a replace with a load from a different table, in which case the replace appears to work as intended.
I can't get REPLACE LOAD to work at all with LOAD RESIDENT (V9 SR2).
The way I would normally do this is:
TEST:
LOAD ...
TESTtemp:
LOAD ... RESIDENT TEST
DROP TABLE TEST;
RENAME TABLE TESTtemp to TEST;
-Rob
OK.
As I notice, there are TWO similar answers, both them suggesting me to use the RENAME approach.
However, I still dont understand the original intent to use the REPLACE LOAD. I can't see the point.
What's that used for ? What's the idea ? I don't get it.
You LOAD something and then, simply LOAD something new ONTO it, totally discarding the previous LOAD. There's no point.
IMHO, the REPLACE LOAD is mistakenly implemented.
Anyway, hope someone else from QlikTech can enlighten us about it.
How do we call them ? Where's the "QlikTech, Look at this point here!" button ?
See ya !
Honestly, I have no idea what the replace load is for. I've never used it, and it looks pointless. Hopefully someone can explain.
REPLACE ONLY LOAD is used with the partial reload feature when you want to reload selected tables while retaining other previously loaded tables.
I don't know of a practical use of REPLACE without using partial reload.
-Rob