Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
Akina0929
Creator
Creator

Replace field value?

HI,

I have a field it,s like as shown in image, I want to Replace marked values into ABC .please help me how can i achieve.

1 Solution

Accepted Solutions
qlikview979
Specialist
Specialist

Use this

Replace(Value,(SubField(Value,'-',3)),'XYZ') as check1

it will give 3rd position

XYZ

View solution in original post

6 Replies
qlikview979
Specialist
Specialist

Use this

Replace(Value,'555','ABC') as check

qlikview979
Specialist
Specialist

Hi,

T1:

LOAD * Inline [

Value

001-0525-04-555-121

001-0525-02-555-121

001-0525-01-555-121

001-0525-04-555-121

001-0525-02-555-121

001-0525-01-555-121

];

NoConcatenate

T2:

LOAD

RecNo() as Rec,

Replace(Value,'555','ABC') as check

Resident T1;

DROP Table T1;

Result:

Untitled.png

Akina0929
Creator
Creator
Author

HI Mahesh,

      if i want replace 3rd position what can i do

qlikview979
Specialist
Specialist

Use this

Replace(Value,(SubField(Value,'-',3)),'XYZ') as check1

it will give 3rd position

XYZ

Akina0929
Creator
Creator
Author

Thank you very much Mahesh,

Frank_Hartmann
Master II
Master II

what happens if your value field looks like:

555-0555-04-555-121  ???

you should try like this:

1:

LOAD * Inline [

Value

001-0525-04-555-121

001-0525-02-555-121

001-0525-01-555-121

001-0555-04-555-121

555-0555-04-555-121

];

NoConcatenate

2:

LOAD

*,

subfield(Value,'-',1)&'-'&subfield(Value,'-',2)&'-'&subfield(Value,'-',3)&'-'&Replace(subfield(Value,'-',4),'555','ABC')&'-'&subfield(Value,'-',5) as newValue

Resident 1; DROP Table 1;