This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I am trying to merge two sources, one is string (a bunch of headers and subheaders) and the other is numeric (corresponding amounts) using the Union (circle). The end result is everything is string. This is an issue for me as I need the amounts to stay numeric while keeping the headers lines text. When I try to use Select or Multi-field tools to change the amounts back to numeric, it either deletes the headers or turns them to 0, respective (circles).
How can I keep the lines (top arrow) as text, while everything else below (bottom arrow) as numeric?
for each column, you have to decide for one specific datatype. In the situation you decribed, the column should be V_STRING, as a column of this datatype can contain both numeric and string data (but treats numeric data as "string"). The drawback is, that you have to use conversion formulas (e.g. ToNumber) to perform numeric calculation on the respective field (you will have to check, if it is possible to convert the value to numeric and perform conversion only, if it's possible). I hope, this is helpful in any way ...
Like @RolandSchubert said. One data type per field. String is the type that can hold any data, so that's what unioned fields end up as. The vast majority of times that this situation arises is to dump a report to either text or Excel with multi-line header info, which isn't supported in Alteryx.
The way to mitigate this is to make sure you perform all your numeric calculations and union the rows right before the output tools.