Alteryx Designer Desktop Discussions

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

Convert Date Format to Double data type

vkarthi8
7 - Meteor

How to convert Date format in yyyy-mm-dd to yyymm in Double data type format?

4 REPLIES 4
aatalai
13 - Pulsar

@vkarthi8 is the date in format or in double?

aatalai
13 - Pulsar

do you mean that you want it to go from yyyy-mm-dd as date to YYYYMM as just a string of numbers?

 

If so try this in the formula tool with the following formulas

 

a) replace(tostring( [field]),"-","") set this to be string

 

b) tonumber( left([new field],6)) set this to be number output

 

You can combine this all into one with

 

tonumber( left(replace(tostring( [field]),"-",""),6)) setting output to number 

 

vkarthi8
7 - Meteor

Thank you.. This formulae worked " tonumber( left(replace(tostring( [field]),"-",""),6)) setting output to number "

aatalai
13 - Pulsar

@vkarthi8 great can you mark the post as the solution please?

 

Labels