Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Changing Field`s values

Hi,

I am trying to assign new na

8 Replies
vinieme12
Esteemed Contributor II

Re: Changing Field`s values

beck110979
Valued Contributor III

Re: Changing Field`s values

Hi Saher,

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

beck

Not applicable

Re: Changing Field`s values

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

Re: Changing Field`s values

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
Esteemed Contributor

Re: Changing Field`s values

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

beck110979
Valued Contributor III

Re: Changing Field`s values

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
Esteemed Contributor

Re: Changing Field`s values

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

Re: Changing Field`s values

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

Community Browser