Hi
I am having an issue with a total formula - I am trying to create a total column to sum 5 x columns of data - for 3 of the 20 rows I am getting 0 as the total unexpectedly.
I searched the forum and used the select function to ensure each of the subsidiary columns were "Double" - I also used data cleansing to ensure that blanks / 0 were replaced but still I am getting the nil values for these rows.
Would anyone have any ideas of how I might resolve ?
Thanks
Chris
Solved! Go to Solution.
Could you show me how the data looks like just before the formula tool?
Thanks,
Josh
Thanks so much - that worked - might I ask what I did wrong ?
Chris
Great, I'm glad to hear that!
Basically, Alteryx was adding the columns incorrectly because some of the columns contained null values. If you look at the picture of the excel file below, you can see how some columns just have empty values rather than 0s.
Alteryx treats 0s and nulls differently. It can add 0s but not nulls. That's why when Alteryx tried to add the null values with other numbers in the Formula tool, it automatically outputted a null value.
That was why the first two columns worked because it was adding two 0s. But when it tried to add the third column, it was adding a null value and therefore not outputting the correct value.
The way to solve this was to add the data cleansing tool before the formula tool and selecting Replace with 0. This replaces all the null values with 0s and ensures that the column does not contain any null values. Now, that there are no null values, the formula tool was able to correctly add the values.
Thanks,
Josh
Thanks again - I see my error now
Chris
Josh,
I hope your well.
What is the most efficient way in your mind to set any fields back to Null afterwards?
I only want to change back the ones that got amended within the data cleanse. The reason is 0 could actually be a relevant value in my case
Hi @AdamWatson,
Sorry I didn't reply earlier. Was enjoying the holidays!
I think in this scenario I would probably use a multi-field formula tool to create new fields without the nulls. Then, this would allow you to have a field which you can make calculations on and another field which identifies whether that value was a 0 or a null.
For example, something like this:
Unfortunately, this may increase the number of fields significantly but it's the best option I can think of at the moment.
Thanks,
Josh
No problem, glad you enjoyed the holidays.
Good idea thanks for you help.