Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Changing Field`s values

Hi,

I am trying to assign new na

8 Replies
vinieme12
Champion III
Champion III

Try Applymap()

http://www.learnqlickview.com/applymap-function-in-qlikview/

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
beck_bakytbek
Master
Master

Hi Saher,

what kind of output do you expect? give an example like a screenshot?

beck

Not applicable
Author

Hi Beck,

I mean basically, I want my contract type column to only have 4 values, T&M, FFP, Mixed, and Cost.  currently it has all the values listed in my Ifwildmatch statement.  I would like to do this at the data load script level because I want that "field/column" contract type to be the same "has only 4 values listed above" .  What do you recommend?

If I can get this done "just changing the values of that field "contract type"" at the data load level then It will be very easy to run any measurements at sheets level.

Not applicable
Author

Thank you Vineeth, it didn`t work

ApplyMap([Contract Type],'FFP LOE','ROM')AS ['T&M']

The following error occurred:

ApplyMap error:
map_id not found

OmarBenSalem

You can do as follow;

NewTable:

load *,

'T&M' as NewField

resident OriginalTable

where

match([Contract Type],'*FFP LOE*','*FFP LOE','#LH','#BPA/Rate Card*',

'*ROM*','*T&M','#BPA/Rate Card*','*FFP;#BPA/Rate Card;#IDIQ*' etc...) ;

concatenate

load *,

'FFP' as NewField

resident OriginalTable

where match("Contrat Type",'...','..','...')....;

and so on ..

drop table OriginalTable

beck_bakytbek
Master
Master

Hi Saher,

the solution of @omar bensalem is very good, try it to implement, and if you dont solve your issue. let me know, we find solution for your issue

beck

OmarBenSalem

ApplyMap is not the answer here;

Let me explain the utility of applyMap;

Suppose you have table 1 like this:

ID, Country, Sales

1, Tunisia, 500

2, Tunisia, 10000

3, Algeria, 300

and a second table like this:

ID, Name

1, Omar

2, Rayhana

if you do a left join, you'll have

ID, Name, Country, Sales

1, Omar ....

2, Rayhana ....

3 , NULL()....

In this case, we use ApplyMap function to Map the second table to the first one based on the ID and if there is NULL values like in the above example, we can replace It by sthing.

Example of output:

ID, Name, Country, Sales

1, Omar ....

2, Rayhana ....

3 , Missing....

But the syntax is not as you did; please refer to the link Vineth shared with you and here's an example:

table2:

Mapping LOAD
ID,
Name;
from ...;

Table1:
LOAD ID,

Country,

Sales
ApplyMap('table2',ID,'MISSING') as Name;
from ...;

Not applicable
Author

Yeah you are right, I am working on one table so that's why ApplyMaping didn`t work, I`ll try your solution though