I am getting an error - the field resulted in a string but it is numeric.
- 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, I am getting an error "the field resulted in a string but it is numeric". Alteryx is suggesting to add the ToNumber formula.
My data type is "int64", so I don't know what I am doing wrong.
Can someone let me know how to apply the ToNumber formula to the statements below? Any help will be much appreciated!
Virtual column
If IsNull([Actual # of Virtual Attendees]) THEN [Virtual est attendees] ELSE [Actual # of Virtual Attendees] ENDIF
In-Person column
If IsNull([Actual # of In-person Attendees]) THEN [Request Expected Attendees] ELSE [Actual # of In-person Attendees] ENDIF
Total Attendance
[Attendance - InPerson]+[Attendance - Virtual]
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Marcegon
Solution:
Virtual column
If IsNull([Actual # of Virtual Attendees])
THEN tonumber([Virtual est attendees])
ELSE tonumber([Actual # of Virtual Attendees])
ENDIF
In-Person column
If IsNull([Actual # of In-person Attendees])
THEN tonumber([Request Expected Attendees])
ELSE tonumber([Actual # of In-person Attendees])
ENDIF
Total Attendance
tonumber([Attendance - InPerson])+tonumber([Attendance - Virtual])
I have mocked up the data to explain your issue.
The column ACTUAL is a String datatype.
But when I am using a formula to copy to the new column VIRTUAL COLUMN, I have defined the column datatype as INT64.
Hence STRING to INT datatype issue is happening.
Solution:
Many thanks
Shanker V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Marcegon ,
The error message should say which Expression is in problem (as underlined in Green).
Once you locate the expression, please double check if the data type of the result is numeric.
If IsNull([Actual # of Virtual Attendees])
THEN [Virtual est attendees]
ELSE [Actual # of Virtual Attendees]
ENDIF
If you still see the expression is OK, please consider attaching the workflow packaged with the input data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, I am still learning Alteryx, so I am not sure what I need to do. I am trying to add the numbers in (2) columns but I am getting the error I mentioned before, and the numbers are not adding up. I selected the Function, then operator "addition" and data type int64 but it is not working. See example below:
In Person Virtual Total Attendance
500 28 50028
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Marcegon ,
In this kind of error, it is more effective to see the real data.
Can you save the workflow with menu
"Options > Export Workflow"
to package the data with the workflow and attach the package (.yxzp file)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Marcegon
Could you please try the below.
Total Attendance
tonumber([Attendance - InPerson])+tonumber([Attendance - Virtual])
We can't do addition on String datatype, even though the numbers are stored in string.
Hence you can use tonumber([column name]) and then perform the addition.
Hope this helps!!!!!
Many thanks
Shanker V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
Just use the ToNumber function when performing the addition on the last column as string data types cannot be added. That is why you need to use the tonumber() function to add the two columns.
Kindly refer to the below article to understand more about the tonumber() function.
https://help.alteryx.com/20223/designer/conversion-functions
Hope this helps.
Thanks,
Lakshya Pant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This worked! Thank you so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you!
