Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a QVD with five weeks.i need each week as a single qvd.
ex:2013W01->1qvd
2013W02->1qvd
etc.....please find the attachment.
Thanks
Please check out attached file
Try something like the following:
let vMaxWeek = max(week(date))
let vMinWeek = min(week(date))
let QVDDirectory = 'your directory'
FOR i = $(vMinWeek) TO $(vMaxWeek)
LET t = "Week_" & ($(i));
load * from your table
where i = week(date)
STORE [$(t)] INTO [$(QVDDirectory)\DM_$(t).QVD] (qvd);
NEXT i
LET vTotalTables = NULL();
LET t = NULL();
to be precise
week(date)-> weekname(date)
LET t = "Week_" & replace(weekname($(i)),'/','') maybe...
Please see attached file :
LOAD week
FROM
C:\Users\user\Downloads\week.qvd
(qvd);
IF NoOfRows('week') > 0 THEN
FOR j = 1 TO FIELDVALUECOUNT('week')
LET currentWeek = FIELDVALUE('week',$(j));
[$(currentWeek)]:
LOAD
'$(currentWeek)' as FilteredWeek
AutoGenerate(1);
STORE [$(currentWeek)] into C:\Users\user\Downloads\$(currentWeek).qvd (qvd);
DROP Table [$(currentWeek)];
NEXT
ENDIF
Well that is exactly what this script does. Did you try it?
Hi Ioannis
Thanks for your reply. I tried with your script, its working fine. But I am trying to do the same with the attached Qvd, am not able to generate Qvd's. Pls help me.,
Regards,
Gowthami
Try this,
If u have a date field in ur table then do likethis
YearWeek:
Load distinct Yearweek(Datefield) as weekyear from sales.qvd order by Datefield;
Rows=Noofrows(Yearweek)-1;
Startrow=0;
Do
Yearweek=Filedvalue(weekyear,$(Startrow));
Ta:
Load * fron Sales.qvd where Yearweek(Datefiled)=$(Yearweek);
Store tab into "F:\Sales_$(Yearweek)";
Startrow=Startrow+1;
while(Rows>=Startrow)
Regards,
Kabilan K.
Pls change the Yearweek() function as Weekname() in my prev reply
Please check out attached file