Select Tool
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,how could i automatically choose all columns with v string data type to change to numeric data?I have a lot of columns and it is time consuming to select each column manually in select tool to change data type.
- Labels:
- Preparation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @gsafaraliyeva ,
What you can do is use a dynamic select tool to only keep the fields that are a VString data type. Then with another select tool you can convert it to a numeric data type (a double for example.
Then the other data stream will keep all columns that are not a VString, so those you don't want to convert
You can ignore the first select tool, I have used it to convert some of the columns to a Vstring initially as Alteryx reads everything as an integer
Hope that helps,
Angelos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can achieve this with a single multi-field formula!
Simply check off the fields you want to adjust (you can also select a certain field type and check off dynamic to account for new data later on too, and use the "all" button to check off everything with that field type). Then, check off the change output type to option and select a numeric field type. The expression would just be the current field wrapped in tonumber() for the conversion.
Also, pro tip: you can drag and highlight multiple fields, and change their type in bulk in the Select tool.