Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Live chat with experts, bring your API Integration questions. June 15th, 10 AM ET. REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
surajdhall
Contributor III
Contributor III

all qvds in one table

Hi All,

I want to load all the qvd's into single table and create a new COUNTRY field in final table based on File name.
eg- if file name is Sales_ind* then COUNTRY field contain value as IND

Please note that all the qvds have slighly different fields, so we need to force concatenation using concatenate keyword.

Thanks!

Labels (1)
1 Solution

Accepted Solutions
rwunderlich
Luminary Alumni
Luminary Alumni

Data:
LOAD 0 as DummyField AutoGenerate 0;

Concatenate (Data)
LOAD *,
SubField(FileBaseName(), '_', 2) as Country
FROM [*.qvd] (qvd);

DROP Field DummyField

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

3 Replies
dilipranjith
Partner
Partner

change your script to below

Set vConcatenate = 0;
For each vFile in FileList('.\*.qvd')
	if($(vConcatenate) = 0) THEN
	  Data:
	  LOAD *
	  FROM [$(vFile)](qvd);
	   Set vConcatenate = 1 ;
	ELSE
	  Concatenate(Data)
	  LOAD *
	  FROM [$(vFile)](qvd);
	end if
Next vFile

 

rwunderlich
Luminary Alumni
Luminary Alumni

Data:
LOAD 0 as DummyField AutoGenerate 0;

Concatenate (Data)
LOAD *,
SubField(FileBaseName(), '_', 2) as Country
FROM [*.qvd] (qvd);

DROP Field DummyField

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

surajdhall
Contributor III
Contributor III
Author

Thank you so much