Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
jash
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
dilipranjith
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
dilipranjith
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