Discussion Board for collaboration on QlikView Scripting.
I have a QVD with five weeks.i need each week as a single qvd.
etc.....please find the attachment.
Go to Solution.
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
LET t = "Week_" & replace(weekname($(i)),'/','') maybe...
Please see attached file :
IF NoOfRows('week') > 0 THEN
FOR j = 1 TO FIELDVALUECOUNT('week')
LET currentWeek = FIELDVALUE('week',$(j));
'$(currentWeek)' as FilteredWeek
STORE [$(currentWeek)] into C:\Users\user\Downloads\$(currentWeek).qvd (qvd);
DROP Table [$(currentWeek)];
Well that is exactly what this script does. Did you try it?
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.,
If u have a date field in ur table then do likethis
Load distinct Yearweek(Datefield) as weekyear from sales.qvd order by Datefield;
Load * fron Sales.qvd where Yearweek(Datefiled)=$(Yearweek);
Store tab into "F:\Sales_$(Yearweek)";
Pls change the Yearweek() function as Weekname() in my prev reply