Alteryx Designer Desktop Discussions

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

How to edit Xml Syntax

Mukeshy12390
8 - Asteroid

Hello All,

 

I have been trying to edit Xml for formula tool [Date] but somehow getting syntax error I figured out the issue but not able to add apostrophe " ' ".

 

this is syntax I'm using 

 

'<FormulaField expression="DateTimeFormat(DateTimeParse('+[FieldName_Bracket]+',"'+[Date_Format_Alteryx] +'"),"%Y-%m-%d")" field="'+[DummyColumnName]+'" size="10" type="Date" />'

 

this is the after reading variable :

'<FormulaField expression="DateTimeFormat(DateTimeParse([Trd_Dt],"%Y%m%d"),"%Y-%m-%d")" field="Trd_Dt_DummyColumn" size="10" type="Date" />'

 

according to my finding it is these two  ---> "%Y%m%d"),"%Y-%m-%d" --> it should be surrounded by apostrophe " ' " instead of quote

 

 

May be I'm wrong , just wanted to correct this formula.

 

'<FormulaField expression="DateTimeFormat(DateTimeParse('+[FieldName_Bracket]+',"'+[Date_Format_Alteryx] +'"),"%Y-%m-%d")" field="'+[DummyColumnName]+'" size="10" type="Date" />'

 

 

 

 

any help would be appreciated.

 

Thanks,

Mukesh Y

 

 

 

 

 

2 REPLIES 2
patrick_digan
17 - Castor
17 - Castor

@Mukeshy12390 If your formula has quotes, the easiest path is to convert them to &quot; 

So it would be something like this:

 

'<FormulaField expression="DateTimeFormat(DateTimeParse('+[FieldName_Bracket]+',&quot;'+[Date_Format_Alteryx] +'&quot;),&quot;%Y-%m-%d&quot;)" field="'+[DummyColumnName]+'" size="10" type="Date" />'

If you look at a formula tool's xml, you can see this same structure:

image.png

 

Mukeshy12390
8 - Asteroid

Thanks !! you are awesome.

 

Labels