Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
is the "for each" statement skipped during Partial Reload?
Edit: the problem wasn't in the "for each" statement, it works correctly.
The problem is the initialization of the variable vClassi:
let vClassi = peek('classi');
Thanks,
Massimiliano.
Hi,
is the field classi unique in the datamodel? If not you should modify peek by peek('classi', -1, 'CLASSI_TABLE');
Best regards
Stefan
i dont think so.
if For each statement is there in table while partial reloading then it will excute
i am not sure pls let me know if any changes
This is the portion of the script:
if IsPartialReload() then
drop Table CROSS_FINAL;
ENDIF
for each K in $(vClassi)
CROSS_FINAL:
add load '$(K)' & [Classe valore] AS INCROCIO_CROSS,
'$(K)' AS CROSS_CONSUMO,
[Classe valore] AS CROSS_GIACENZA,
$(K) AS VALORE
resident CROSS_TMP;
next K
//At this point, the table CROSS_FINAL doesn't exist!
Hi,
it means it is going to ignore the for each script right?
Yes...
Hi,
The add command during a partial reload behaves very much like a concatenate. If the table doesn't exisit then there's nothing to add the new data too.. therefore its skipped.
Richard
QlikCentral.com
Hi Richard,
thanks for the reply but the add command now works fine (also the table was empty).
The problem is the initialization of the variable vClassi:
let vClassi = peek('classi');
Any suggestions?
Thanks in advance,
Massimiliano.
Good to hear Massimiliano, when I read your text it said the table didn't exist which threw me.
First question would be what was the last table loaded and was the field classi in there?
As you're not defining the table name and row number in the peek statement (which would probably be better practice) the last table is assumed (and the last record of the table).
Have you confirmed what the value is in the data to ensure its not a null or some other value?
Rcihard
Richard,
this is the portion of code:
CLASSI_TABLE:
replace
load concat (chr(39) & [Classe valore] & chr(39),',') AS classi
resident CROSS_TMP;
let vClassi = peek('classi');
This code works perfectly in full Reloa, but when I try the Partial Reload it doesn't work (the variable is empty after partial reload).
Massimiliano.
Hi,
I've tested the code and it works fine for both partial and full reloads.
The only question would be the data table it's self. I see its from a resident load. Does that table exist? and have you checked the last record in the table, does it have a value?
Richard