Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
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
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
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