Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I have a question regarding FOR-loops. I want to, in my script, basically iterate through my Date-field and save my Articlenumber and Inventoryvalue (fields) for that date into seperate qvd-files for each date
Anyone got any example of this?
Thanks!
Hello,
It should look like the following
PossibleValues:LOAD CONCAT(Date, chr(39) & ', ' & chr(39)) AS AllDatesRESIDENT Sales; LET vPossibleDates = chr(39) & Peek('AllDates', 0) & chr(39); FOR EACH vDate IN $(vPossibleDates) Temp: NOCONCATENATE LOAD * RESIDENT Sales WHERE Date = '$(vDate)'; STORE Temp INTO File_$(vDate).qvd; DROP TABLE Temp; NEXTPlease take into account that loops are very slow and would result in poor performance and longer loading scripts.
Hope this helps
Hello,
It should look like the following
PossibleValues:LOAD CONCAT(Date, chr(39) & ', ' & chr(39)) AS AllDatesRESIDENT Sales; LET vPossibleDates = chr(39) & Peek('AllDates', 0) & chr(39); FOR EACH vDate IN $(vPossibleDates) Temp: NOCONCATENATE LOAD * RESIDENT Sales WHERE Date = '$(vDate)'; STORE Temp INTO File_$(vDate).qvd; DROP TABLE Temp; NEXTPlease take into account that loops are very slow and would result in poor performance and longer loading scripts.
Hope this helps
I found a similar way to yours that did it bu´t your idea works too, thanks!