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

Data Transformation

Hi All,

I need to transform data and tried using match function but was not successful. So here i'm for help please help me

I have a field name "Line" with 2 values (HINDU and TIMES) and the requirement is where ever the value "TIMES" exists it should be replace by " ECONOMIC". Please help me

Attached the excel with the sample data.

Regards,

Ramya

1 Solution

Accepted Solutions
rahulpawarb
Specialist III
Specialist III

Hello Ramya,

You can try below given approaches:

1. Using REPLACE Function

//This approach will not work as expected if Line field has value word with TIMES in it.

// e.g. MEGATIMES - This will produce result as MEGAECONOMIC

Replace(Line, 'TIMES', 'ECONOMIC') AS Line

2. Using IF Function

If(Line = 'TIMES', 'ECONOMIC', Line) AS Line

Hope this will be helpful.

Regards!

Rahul

View solution in original post

3 Replies
rahulpawarb
Specialist III
Specialist III

Hello Ramya,

You can try below given approaches:

1. Using REPLACE Function

//This approach will not work as expected if Line field has value word with TIMES in it.

// e.g. MEGATIMES - This will produce result as MEGAECONOMIC

Replace(Line, 'TIMES', 'ECONOMIC') AS Line

2. Using IF Function

If(Line = 'TIMES', 'ECONOMIC', Line) AS Line

Hope this will be helpful.

Regards!

Rahul

ramyasaiqv
Creator II
Creator II
Author

It worked. Thank you Rahul,

Ramya

rahulpawarb
Specialist III
Specialist III

Cheers,

Ramya