Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
SK28
Creator
Creator

Search a Text in a String & replace it with Blanks

Hi,

I have a Free text field in qliksense

Data - configuration and performance  of Integration with Qliksense, we will do first

Data in Qliksense table dislaying as - configuration and performance{color:#4c9aff} of Integration{color:#4cff} with Qliksense, We will do first{color}

Expected resultconfiguration and performance  of Integration with Qliksense, we will do first

 

I want to search for these kind of  {color:#4c9aff} & {color:#4cff} & {color} color code in my description field and replace it with blanks.

 

1 Solution

Accepted Solutions
justISO
Specialist
Specialist

just adjust previously provided expression with {color:

=replace( replace( replace( replace([your_data_field] , TextBetween([your_data_field], '{color', '}', 1), ''),
TextBetween([your_data_field], '{color', '}', 2), '') , TextBetween([your_data_field], '{color', '}', 3), '') , '{color}', '')

View solution in original post

9 Replies
justISO
Specialist
Specialist

Hi, maybe try something like this:

=replace (replace( replace([your_data_field], '{color:#4c9aff}', '') , '{color:#4cff}', ''), '{color}', '')

SK28
Creator
Creator
Author

Yes but This is not dynamic right, Is it possible to search anything that has '{colo*' AND REPLACE IT WITH '' (Blanks)

 

If they have used any other color, then new color code {'color:45dff4f'} will show up right so, looking for dynamic solution

Lakshminarayanan_J

@SK28 

Kindly try on below expression ,

If(Wildmatch(FiledName,'colo*'),null(),FiledName) as [New Value],

Lakshminarayanan J
To help users find verified answers, please don't forget to use the "Accept as Solution" button
justISO
Specialist
Specialist

Yes, it is not dynamic, but, if there are only 3 possible {...} text places in your data_field, you can replace any text between braces {} to blanks (and {} itself) with something like this:

=replace( replace( replace( replace([your_data_field] , TextBetween([your_data_field], '{', '}', 1), ''), TextBetween([your_data_field], '{', '}', 2), '') , TextBetween([your_data_field], '{', '}', 3), '') , '{}', '')

SK28
Creator
Creator
Author

Data in Qliksense table dislaying as - configuration and performance{color:#4c9aff} of Integration{color:#4cff} with Qliksense, We will do first{color}

Expected result configuration and performance  of Integration with Qliksense, we will do first

 

I just want to remove/replace these kinds of {color:#4c9aff} color codes with ''(blanks)

the above syntax will completely eliminates the data.

SK28
Creator
Creator
Author

this is partially correct, But I want to do this dynamically anything which has '{color  in it

justISO
Specialist
Specialist

just adjust previously provided expression with {color:

=replace( replace( replace( replace([your_data_field] , TextBetween([your_data_field], '{color', '}', 1), ''),
TextBetween([your_data_field], '{color', '}', 2), '') , TextBetween([your_data_field], '{color', '}', 3), '') , '{color}', '')

SK28
Creator
Creator
Author

if there are morethan 3 then? we never know how many such possibilities are there? Can this be achieved?

justISO
Specialist
Specialist

I don't know any way how to know how many {color} possibilities are in the sentence. But you can add more textbetween() parts, as each are taking specific braces in text (it is defined in 3rd parameter of this formula), to be safe each {color} is removed.