Discussion Board for collaboration on QlikView Scripting.
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');
Go to Solution.
is the field classi unique in the datamodel? If not you should modify peek by peek('classi', -1, 'CLASSI_TABLE');
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;
for each K in $(vClassi)
add load '$(K)' & [Classe valore] AS INCROCIO_CROSS,
'$(K)' AS CROSS_CONSUMO,
[Classe valore] AS CROSS_GIACENZA,
$(K) AS VALORE
//At this point, the table CROSS_FINAL doesn't exist!
it means it is going to ignore the for each script right?
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.
thanks for the reply but the add command now works fine (also the table was empty).
Thanks in advance,
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?
this is the portion of code:
load concat (chr(39) & [Classe valore] & chr(39),',') AS 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).
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?