Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sona_sa
Creator II
Creator II

Replace Value field from Script

Hi All,

In this attached qvw, I have to replace the Value field, Where ever T-Mobile, T-Mobile US, T-Mobile D is available, I want to replece the same value with only T-Mobile.


Similary for Vodafone and TMO.


Please find the attached QVW.


Thanks

AK

1 Solution

Accepted Solutions
4 Replies
prieper
Master II
Master II

Hi,

think that it is easier to work with a mapping table:

mapCustomer:

MAPPING LOAD * INLINE [read, write

T-Mobile, T-Mobile

T-Mobile US, T-Mobile

T-Mobile D, T-Mobile];

Data:

LOAD

*,

APPLYMAP('mapCustomer', Customer)          AS Customer_mapped

FROM

.....;

APPLYMAP will translate only the listed entries. Others will be show unchanged.

HTH

Peter

Edith would like to add that the mapping may also be loaded from an external table, like Excel - thus easy to maintain.

sona_sa
Creator II
Creator II
Author

Hi Peter,

I tried, Not working this Applymap in my qvw.

Please find the attached qvw and Xls.

Regards,

AK

prieper
Master II
Master II

Hi,

might be worth to question the datamodel,

anyhow:

load the mapping, as needed (and add all the VODAFONE etc) and put in line 79 as line like

If([Final Field] = 'OPERATOR', APPLYMAP('mapCustomer', Value)) AS NewField1

should then do

Peter

sona_sa
Creator II
Creator II
Author

Thanks. Done