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 ?
Sourcefile is just ONE file with DateColumn as i mentioned before.
Not multiple files.
But the Output or the Result should be : All the years and months that exist in Date Column : Take that and create a qvd out of each one .
So 201601.qvd
201602.qvd etc.
Understand now?
Akintosh,
I suggest you to create one Master file for that. Then just pause those pseudo columns into Different variables with .QVD then you will achieve.
Why would i need to do that ?
It is already one file with just one Date Column.
So all i need is to create a qvd for every month that exist in Date Column.
and store them like 201601.qvd 201602.qvd etc..
Try below code:
Temp:
LOAD distinct MonthStart(Date) as DateTemp
FROM
source.qvd
(qvd);
let Vm=NoOfRows('Temp');
for I=0 to $(Vm)-1;
LET vFileName=Date(Peek('DateTemp',$(I),'Temp'),'YYYYMM');
Let vMonthFilter = Peek('DateTemp',$(I),'Temp')
noconcatenate
Temp2:
Load * From source.qvd(qvd)
where MonthStart(Date) = '$(vMonthFilter)'
STORE Temp2 into $(Vmonth).qvd (qvd);
drop table Temp2;
NEXT I;
Wont this take every row ?
let Vm=NoOfRows('Temp');
I need for every month in the Date Column, not every row in the Table.
Try this,
MyQvd:
LOAD *, Date(Date,'YYYYMM') as YearMonth
FROM
source.qvd
(qvd);
Temp:
Load Distinct YearMonth
Resident Temp;
let Vm=NoOfRows('Temp');
for I=0 to $(Vm)-1;
LET vFileName=Peek('YearMonth',$(I),'Temp');
Table:
NoConcatenate
Load * resident MyQvd
where YearMonth = '$(vFileName)';
STORE Table into $(vFileName).qvd (qvd);
drop table Table;
NEXT I;
DROP Table Temp, MyQvd;
Anil,
I am just storing the each field max and min value in seperate variables.
".qvd" this is the result.
So instead of 6 different monthly qvds i got one qvd with no name.
there is no let function for Vmonth in the script u provided maybe that is why ?
"STORE Temp2 into $(Vmonth).qvd (qvd); "
Hi Mahesh.
I'll check and let you know by evening.