10 Replies Latest reply: Dec 13, 2013 9:42 AM by GOWTHAMI B

# Qvd separation

Hi,

I have a QVD with five weeks.i need each week as a single qvd.

ex:2013W01->1qvd

2013W02->1qvd

Thanks

• ###### Re: Qvd separation

Try something like the following:

let vMaxWeek =  max(week(date))

let vMinWeek = min(week(date))

FOR i = \$(vMinWeek) TO \$(vMaxWeek)

LET t = "Week_" & (\$(i));

where i = week(date)

STORE [\$(t)] INTO [\$(QVDDirectory)\DM_\$(t).QVD] (qvd);

NEXT i

LET vTotalTables = NULL();
LET t = NULL();

• ###### Re: Qvd separation

to be precise

week(date)-> weekname(date)

LET t = "Week_" & replace(weekname(\$(i)),'/','') maybe...

• ###### Re: Qvd separation

FROM

(qvd);

IF NoOfRows('week') > 0 THEN

FOR j = 1 TO FIELDVALUECOUNT('week')

LET currentWeek = FIELDVALUE('week',\$(j));

[\$(currentWeek)]:

'\$(currentWeek)' as FilteredWeek

AutoGenerate(1);

DROP Table [\$(currentWeek)];

NEXT

ENDIF

• ###### Re: Qvd separation
Hi Ionnis,  Thanks for your reply.I need the single qvd to be splitted into five Qvd's based on week.  Thanks Gowthami
• ###### Re: Qvd separation

Well that is exactly what this script does. Did you try it?

• ###### Re: Re: Qvd separation

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

• ###### Re: Qvd separation

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.

• ###### Re: Qvd separation

Pls change the Yearweek() function as Weekname() in my prev reply