Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

How to create Year wise Qvd dynamically

Hi,

I have requirement to create year wise qvd dynamically.

EX:-if Source file:-  Market.xls

In Market file have contain multiple year (Like year field contain 2010 to 2019 )

So i need to create qvd like :- Market_2010.qvd,Market_2011.qvd,....Market_2019.qvd

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

use a for loop something like below

TempYear:
load Distinct Year
resident Sales;

LET NumRows=NoOfRows('TempYear');
trace $(NumRows);
For n=1 To $(NumRows)
	
	let vYear = Peek('Year',$(n)-1,'TempYear');	
	trace $(vYear);
	TempSales:
	NoConcatenate
	load *
	resident Sales where Year=$(vYear);
	
	let vFileName='Sales-' & $(vYear);
	store TempSales into $(vFileName).qvd (qvd);
	drop table TempSales;
next n;
drop table TempYear;

View solution in original post

1 Reply
Highlighted
Partner
Partner

use a for loop something like below

TempYear:
load Distinct Year
resident Sales;

LET NumRows=NoOfRows('TempYear');
trace $(NumRows);
For n=1 To $(NumRows)
	
	let vYear = Peek('Year',$(n)-1,'TempYear');	
	trace $(vYear);
	TempSales:
	NoConcatenate
	load *
	resident Sales where Year=$(vYear);
	
	let vFileName='Sales-' & $(vYear);
	store TempSales into $(vFileName).qvd (qvd);
	drop table TempSales;
next n;
drop table TempYear;

View solution in original post