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

Possible to rename one data value?

I am quite familiar with changing field names using the "as" modifier in the load script, but is it possible to rename a data point in a field within a load script (or even better - an object)?  If so, how?

I.E if my field is "Fruits" and I want to rename "oRanjes" to "Oranges", is that possible without editing the underlying data?

1 Solution

Accepted Solutions
Colin-Albert

Yes you can use replace in the load script or on the from end.

Obviously it is better to do it once in the script, but you can test it on the from end.

Also you can cascade several replace commands together.

     replace(replace(replace(field,'aa','cc'),'mm','nn'),'xx','yy')

View solution in original post

14 Replies
munna1317
Creator II
Creator II

use string fuctions it may help you

munna1317
Creator II
Creator II

capitalize( 'oRanjes')

Not applicable
Author

Ah, my example was meant to be just that.  I'm actually looking to entirely rename a single data value within a field, not capitalize it.

Colin-Albert

=REPLACE(Fruits, 'oRanjes', 'Oranges')

maxgro
MVP
MVP

load

    ....

     if(Fruits = "oRanjes", "Oranges", Fruits) as Fruits

also with applymap

munna1317
Creator II
Creator II

hi , plz provide same QVW it is easy solve

thxs ,

Harish

Not applicable
Author

Here you are!  So let's say I want to change the value "Eggplant" to "Aubergine" - how would I do that?

Colin-Albert

The replace function will replace all occurrences of txt1 with txt2 in fieldA

replace(fieldA, 'txt1', 'txt2') as fieldA

replace(Fruits, 'Eggplant', 'Aubergine') as Fruits

Not applicable
Author

So do I include that in the load statement?