Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
gerhardl
Creator II
Creator II

Map Using

Hi,

I'm trying to replace all instance of the word "JJ" or "Jay Jays" with the word "Refinery" in my module. But these will not be the full field values, so the store name for instance may be "JJ - Cape Town" which I then want to change to "Refinery - Cape Town".

These are on multiple fields so I do NOT want to use the REPLACE function, I want to use the "MAP USING" function.

For some reason it's not working, and I think maybe because I need wildcard characters since I'm only replacing PART of the field values.

Currently I have the following:

RefineryMap:

Mapping LOAD

*

INLINE [

MapString, MapValue

JJ, Refinery];

MAP * using RefineryMap;

Data:

LOAD

*normal load script*

12 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Unfortunately, you cant do that. Map Using will always look at the entire string. You will have to do it field by field, either by Replace or MapSubstring. You surely can't have that many fields containing these names?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
gerhardl
Creator II
Creator II
Author

This is from the QV Manual, which surely implies I can do it?

Image.jpg

And yes, it is unfortunately in a lot of fields. It is the name of a company that is changing, and it is referenced in store names, company codes, transaction descriptions, free text comments, etc...

jonathandienst
Partner - Champion III
Partner - Champion III

That is for Map Using which looks at the entire field. The wildcard selects the fields to be mapped, not the field contents where the mapping happens. For example

Map A* Using ....

will apply the mapping to the fields A1, Abracadabra, but not B1 or CompanyName. But it will look at the entire content of these fields for the mapping lookup - which is not your requirement in your original post.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein