Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
i have to 2 months QVDS stores in a location and i want to load last three week qvd data in appllication where qvd name is like
profit_20191010.qvd
profit_20191011.qvd etc and one week have 5 days so week day chekc is 5(monday to friday ).
Thanks
AT
Hi,
According to the problem description, I assume that:
If the above assumptions are correct, then the following script should do the trick:
//Load today qvd
Profit:
LOAD * FROM [lib://Data/profit_20191111.qvd] (qvd);
//Load 3 weeks of data
Set vNumWeeks = 3;
For i = 1 to (vNumWeeks*7-1)
vDate = Num(Today() - i);
vWeekDay = Num(WeekDay(vDate));
If vWeekDay < 5 Then
vFileName = 'profit_' & Date($(vDate),'YYYYMMDD') & '.qvd';
Concatenate(Profit) LOAD * FROM [lib://Data/$(vFileName)] (qvd);
End If;
Next i;
Hope it helps!
BR,
Vu Nguyen
Hi,
According to the problem description, I assume that:
If the above assumptions are correct, then the following script should do the trick:
//Load today qvd
Profit:
LOAD * FROM [lib://Data/profit_20191111.qvd] (qvd);
//Load 3 weeks of data
Set vNumWeeks = 3;
For i = 1 to (vNumWeeks*7-1)
vDate = Num(Today() - i);
vWeekDay = Num(WeekDay(vDate));
If vWeekDay < 5 Then
vFileName = 'profit_' & Date($(vDate),'YYYYMMDD') & '.qvd';
Concatenate(Profit) LOAD * FROM [lib://Data/$(vFileName)] (qvd);
End If;
Next i;
Hope it helps!
BR,
Vu Nguyen
Hello Vu Nguyen ,
Thanks for replying . i got me right i have separate qvd for daily profit figures . and i wnat to load last three full week data
Profit: LOAD * FROM [lib://Data/profit_20191111.qvd] (qvd);
can u automate this line meaning not hard coding date as 'profit_ '
Hi,
If you always have today in your set of QVD files, you can automate the first load with
//Load today qvd
vTodayQVD = Date(Today(),'YYYYMMDD');
Profit:
LOAD * FROM [lib://Data/profit_$(vTodayQVD).qvd] (qvd);
BR,
Vu Nguyen