Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
angad
Contributor
Contributor

Need Help with looping through dates

Hi,

I am trying to store qvds based on each single day. I have the data In db as

Id, start, end 1, 9/1/2023, 9/30/2022

The above record was actually stored as one record in db but the record was available for 30 days. So in general I need 30 qvds with same record showing up. I was able to get the records seperated out but need help in storing the qvds using loop instead of manually doing the work.

Please provide your thoughts. Any help is highly appreciated!!

Labels (1)
2 Replies
ajaykakkar93
Specialist III
Specialist III

Hi,

You can do it by looping in to the field data.

data:
load * inline [
data,ID
10-Oct-23 10:22:12 AM,1
10-Oct-23 10:22:12 AM,2
10-Oct-23 10:21:55 AM,3
];

FOR Each i in FieldValueList('data')

Final:
LOAD
*
FROM [<path>];

STORE Final into Path\FinalQVD.QVD;
drop Table Final;

NEXT i

DROP Table data;

exit Script;

store the table within the loop

 

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

There are some example script patterns for separating QVDs by date in this post:

https://qlikviewcookbook.com/2022/03/how-to-segment-qvd-files/

-Rob