

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Partial Reload and variables
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.
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
is the field classi unique in the datamodel? If not you should modify peek by peek('classi', -1, 'CLASSI_TABLE');
Best regards
Stefan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
it means it is going to ignore the for each script right?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes...
.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- « Previous Replies
-
- 1
- 2
- Next Replies »