Alteryx Designer Desktop Discussions

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

How do I chenge the field type when using In-DB Connection

Herijale21
5 - Atom

I have data imported into Alteryx using the InDB Connection. The data set is extremely large to use the Data Stream Out on the whole set, so I am trying to cut it beforehand. However, all the Data Fields are Type V_String. Is there an easy way to change the type? I tried to use the Select in DB tool, but it only lets me rename the fields, not change the Type. Is there a better way to do this?

4 REPLIES 4
abe_ibanez
8 - Asteroid

Hello, 
What data type are you trying to change it to? 

I would recommend using the CAST command within your query. For example, if you want to go from string to numeric, you could use CAST(my_string AS INT). 

Herijale21
5 - Atom

I am trying to change it to an INT, would you do this using the formula INDB or a different tool?

apathetichell
18 - Pollux

you should review the sql function commands for the specific syntax of your underlying db. You can then edit in your query itself (case "field" as ...) or in a formula tool using a some kind of cast statment. Note- your fields are "fieldname" vs [fieldname] wen In-DB.

abe_ibanez
8 - Asteroid

Hello, 

I would do it using the Connect In-DB tool. 

Capture3.PNG

If you are using the SQL Builder, you would need to add the CAST command to the Expression Section:

Capture.PNG

 

Otherwise, you can just write it directly on your initial query: 

Capture2.PNG

Labels