Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

change the name of the value in script

I have a field name   GINT  which has  following value   TIm, TWA, TIC,   now i want to convert that value name into  bellow name .

field GINT is comming from  AP TP table

TIm  =    TIm- ta IL CA

TWA=   TIM- Wa AA

TIC=      TA-Ws-CC

 

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

try this:
aux_change:
mapping
load * inline [
key,value
TIm,'TIm- ta IL CA'
TWA,'TIM- Wa AA'
TIC ,'TA-Ws-CC'
];

MAP Field GINT_New Using aux_change;

Table:
load
GINT,
GINT_New
FROM AP TP ;

View solution in original post

5 Replies
Highlighted
Creator II
Creator II

try this:
aux_change:
mapping
load * inline [
key,value
TIm,'TIm- ta IL CA'
TWA,'TIM- Wa AA'
TIC ,'TA-Ws-CC'
];

Table:
load
..
..
applymap('aux_change' , GINT ,GINT ) AS GINT
FROM AP TP ;

Saludos!!!
Highlighted
Creator III
Creator III

Thanks, what i want to keep that old field with old name and and create new field with that new mapping name.  so i can use both field in required place 

Highlighted
Specialist II
Specialist II

You could use a IF instead a mapping,

If(GINT ='TIm','TIm- ta IL CA',If(GINT ='TWA','TIm- ta IL CA','TA-Ws-CC')) AS New_GINT

 

Highlighted
MVP & Luminary
MVP & Luminary

try this:
aux_change:
mapping
load * inline [
key,value
TIm,'TIm- ta IL CA'
TWA,'TIM- Wa AA'
TIC ,'TA-Ws-CC'
];

MAP Field GINT_New Using aux_change;

Table:
load
GINT,
GINT_New
FROM AP TP ;

View solution in original post

Highlighted
Creator II
Creator II

try this:
aux_change:
mapping
load * inline [
key,value
TIm,'TIm- ta IL CA'
TWA,'TIM- Wa AA'
TIC ,'TA-Ws-CC'
];

Table:
load
..
..
GINT,
applymap('aux_change' , GINT ,GINT ) AS GINT_NEW
FROM AP TP ;

but Rwunderlich solution is so so so so so so so so nice!!!