Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Vidit
Creator
Creator

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

ApplyMap('MappingTableName', MappingField) AS NewlyMappedField

vinieme12
Champion III
Champion III

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;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
ciaran_mcgowan
Partner - Creator III
Partner - Creator III

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