Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a qvd file that i need to create from monthly qvd like " 201601.qvd "
How can i do this ?
Hi,
Can you share your files.
Regards,
Mahesh
I cannot im sorry.
I just need to create monthly qvd from the date column in the file.
The output of the qvd should be like 201601.qvd 201602.qvd etc.. and up to Max Date ( Month) in the qvd.
Hi This is help full
Load your QVD then copy the Bold Script may be it will work.
T1:
LOAD Date,
Date1,
Product,
Sales
FROM
(qvd);
let Vm=NoOfRows('T1');
for i=0 to $(Vm)-1;
LET Vmonth=Date(Peek('Date',$(i),'T1'),'YYYYMM');
LET Vday=Peek('Date1',$(i),'T1');
STORE T1 into $(Vmonth).qvd (qvd);
NEXT i;
Note:- check both QVD names is same.like 201601.qvd]
Hi Akintosh,
Try With My QVD SCript You will get correct output.
After load your QVD copy this
let Vm=NoOfRows('T1'); //////Give your table name////
for i=0 to $(Vm)-1;
LET Vmonth=Date(Peek('Date',$(i),'T1'),'YYYYMM');
LET Vday=Peek('Date1',$(i),'T1');
STORE T1 into $(Vmonth).qvd (qvd); /////give your path///
NEXT i;
Regards,
Mahesh
I will, but what is " Date1 " ?
Hi,
Thats my one of the field name i used that for "Daily QVD's" Creation.
Not tested. But try this,
MyQVD:
Load * From yourQVDFile;
Max:
Load Max(Date) as MaxDate,
Min(Date) as MinDate,
Min(Num(Month(Date))) as MinMonth,
Max(Num(Month(Date))) as MaxMonth
Resident MyQVD;
Let vMinDate = Date(Peek('MinDate',0,'Max'),'YYYYMM');
Let vMaxDate = Date(Peek('MaxDate',0,'Max'),'YYYYMM');
Let vMinMonth = Date(Peek('MinMonth',0,'Max'),'YYYYMM');
Let vMaxMonth = Date(Peek('MaxMonth',0,'Max'),'YYYYMM');
DROP Table Max, MyQVD;
FOR year = Year($(vMinDate)) to Year($(vMaxDate))
FOR month = $(vMinMonth) to $(vMaxMonth)
Let vDate = $(year) & Left('0' & $(month) ,2);
MyTable:
LOAD *
FROM
yourQVDFile (qvd)
where Year(Date) = $(year) and MONTH(Date) = $(month);
STORE MyTable INTO $(vDate).qvd;
NEXT
NEXT
Hi Nag Bro,
Can you check once I think my script will work
T1:
LOAD Date,
Date1,
Product,
Sales
FROM
(qvd);
let Vm=NoOfRows('T1');
for i=0 to $(Vm)-1;
LET Vmonth=Date(Peek('Date',$(i),'T1'),'YYYYMM');
LET Vday=Peek('Date1',$(i),'T1');
STORE T1 into $(Vmonth).qvd (qvd);
NEXT i;
Regards,
Mahesh
Hello Mahesh,
The OutPut of qvd should be with max year of the Date column and every month of what is in the Date Column
So :
201601.qvd
201602.qvd
201603.qvd
. Not just Month.
Hi ,
Please check this is my source like three files.