Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

change data in a load

I´ve got a field  [SEX] with the data F or M (female or male).

I want to change the F to a W.

Is this or something like this the way

LOAD [SEX],

IF [SEX]=F then W as SEXa;

Or maybe someone have a better solution??

1 Solution

Accepted Solutions
Not applicable
Author

Hi Kabilan,

Below is the example

 

a:
Mapping 
LOAD * INLINE [
    Current, Changed
       F,W   
];

b:
LOAD * INLINE [
    Sex, Name
    M, Kim
    F, Ruchi
    M, David
    F, Kathe
];
c:
NoConcatenate
LOAD Name, ApplyMap('a',Sex) as Se
Resident b;
drop Table b;

 

 

View solution in original post

8 Replies
fdelacal
Specialist
Specialist

LOAD [SEX],

IF ([SEX]= 'F','W') as SEXa;

trie with this.

MayilVahanan

Hi

try like this

load *,if(sex='f','w',sex) as sex from tablename;

hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi,

You can use the Mapping and Applymap() Concept.

Please refer these two from Qlikview help menu.

Regards,

Kabilan K.

Not applicable
Author

Hi Kabilan

Could you please make an example

Regards

Not applicable
Author

Hi,

LOAD [SEX]

IF([SEX]='F',[SEX]) as SEXa;

Regards,

Prasath

Not applicable
Author

LOAD [SEX],

IF [SEX]=F then W as SEXa;

should be

LOAD [SEX],

IF ([SEX]='F','W') as SEXa;

The field SEXa will have the value W when it was F. It will have a NULL value when it is NOT W... (meaning there is no else defined in the if clause)

Please check the if/else syntax; it is pretty basic ;--)

Not applicable
Author

Hi..

U can use below script....

MapTable:

Load * Inline

[Text, AltText

F,W];

LOAD [SEX],

Applymap('MapTable',[SEX]) as SEXa;

Hope this helps u.

Regards,

Kabilan K.

Not applicable
Author

Hi Kabilan,

Below is the example

 

a:
Mapping 
LOAD * INLINE [
    Current, Changed
       F,W   
];

b:
LOAD * INLINE [
    Sex, Name
    M, Kim
    F, Ruchi
    M, David
    F, Kathe
];
c:
NoConcatenate
LOAD Name, ApplyMap('a',Sex) as Se
Resident b;
drop Table b;