Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
leomathew
Contributor

Loop and replace value using mapping load?

Hi,

I want to replace a value in a particular column in around 100 qvd files, using apply map. How will be the Script

Basically its a simple task like find all occurance of dept a11 and replace it by a12 in all qvds ?

Thanks

3 Replies
Not applicable

Re: Loop and replace value using mapping load?

ApplyMap('MappingTableName', MappingField) AS NewlyMappedField

vinieme12
Esteemed Contributor II

Re: Loop and replace value using mapping load?

Place your Applymap code in the load statement and STORE table into before Next QVFILE Statement

This is assuming all you files are in a same folder. or see this post loop through to load all files from a folder and its subfolders?

FOR EACH QVFILE in filelist('fullpathhere\*.QVD')

load *

From $(QVFILE)

(QVD);

Next QVFILE;

Partner
Partner

Re: Loop and replace value using mapping load?

Hi Vidit,

First you need to load the data in a Mapping Load.

MappingTableName:

Mapping LOAD

     CommonField1,

     NewField

FROM FileName*.QVD;

Then once loaded, use the Apply map syntax on the field that exists in both tables:

ApplyMap('MappingTableName', CommonField2) AS NewField