Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create monthly QVD ?

I have a qvd file that i need to create from monthly qvd like " 201601.qvd "

How can i do this ?

46 Replies
Not applicable
Author

Capture.PNG

Not applicable
Author

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?

Anil_Babu_Samineni

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.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

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..

sushil353
Master II
Master II

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;

Not applicable
Author

Wont this take every row ?

let Vm=NoOfRows('Temp');


I need for every month in the Date Column, not every row in the Table.

tamilarasu
Champion
Champion

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;

tamilarasu
Champion
Champion

Anil,

I am just storing the each field max and min value in seperate variables.

Not applicable
Author

".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); "

tamilarasu
Champion
Champion

Hi Mahesh.

I'll check and let you know by evening.