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: 
QVUser1
Partner - Contributor III
Partner - Contributor III

Create a loop to load only 4 last weeks of data

Hi Team,

I want to create a loop while loading data that it should take only last 4 weeks of the data into app.Where my qvd names are created as shown below:

QVUser1_0-1660737644863.png

 

Labels (4)
2 Replies
Iswarya_
Creator
Creator

Hi @QVUser1 

Try like this below:

FOR EACH vFile IN FILELIST ('lib://Test/CountrySales_*.qvd')
IF(num(DATE#(TextBetween(vFile,'_','.'),'YYYY-MM-DD')) >= TODAY() - (4*7)) THEN

Data:
LOAD *,
FileName('$(vFile)') as QvdName
FROM [$(vFile)](qvd);
END IF
NEXT vFile

QVUser1
Partner - Contributor III
Partner - Contributor III
Author

What is this vFile is this any variable .if so what should we declare in it.