Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Add columns between text

tjamal1
8 - Asteroid

I wanted to add a columns between quotations in my json file in recordID 3

 

for example this should be replaced 

"staticContent": "  "

 

with 

"staticContent": " column2  "

 

7 REPLIES 7
atulggrwl2
7 - Meteor

I don't have Alteyx in my System Can you please share jpeg image for better reference

tjamal1
8 - Asteroid

clipboard_image_0.png

atulggrwl2
7 - Meteor

If field1 equals Blank(StaticContent) then New Column Name

tjamal1
8 - Asteroid

Blank function is not working 
Can you suggest me the proper formula?

atulggrwl2
7 - Meteor

may be its isBlank as, i don't have access to Alteryx so i don't know how to structured formula properly

tjamal1
8 - Asteroid

clipboard_image_0.png

like this?

danilang
19 - Altair
19 - Altair

Hi @tjamal1 

 

Try this Regex based solution

 

Formula.png

 

 

REGEX_Replace([Field_1], '(.*?: ")( )(")', '$1 '+[Daysoftheweek]+ ' $3')  

 

The search strings breaks down to this 

(.*?: ") 1st capture group.  All characters up to the ': "' 

( )        2nd capture group.  The single space between the 2 double quotes

(")       3rd capture group.  The final double quote

 

The replace string is 

'$1 '+  the 1st capture group from above

[Daysoftheweek]+  the contents of the column [DaysoftheWeek].  change this to whatever you need

' $3'    The 3rd capture group 

 

The end result of this is that the 2nd capture group(the single space between the double quotes) is replaced by the contents of the [DaysoftheWeek] column.   

 

The results for your dataset are 

results.png

 

Dan

Labels