Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Sum certain field cells based off certain criteria of the row

jrgreen
7 - Meteor

Sorry if this question is either impossible or extremely easy to accomplish, I am still fairly new to Alteryx and can't seem to figure this one out. 

 

So I have a data set that consists of the following columns: Year, Account, Entity, and Amount. In my data set I have one entity that the amount for a certain account needs to be combined with another account and that row needs to be removed.

 

In short, I need some sort of formula like "If the account number is 56, take the amount from entity 5 and add it to the amount for entity 1 then delete the row for account 5"

 

Here is a screenshot to make life simpler. Thanks!

13 REPLIES 13
jrgreen
7 - Meteor

Okay so I've updated everything and here's what I have.

 

The account field is set to string

The entity field is set to string 

The Total field is set to double

 

After using the updated formula I am still getting an error, this time it says "The formula "New Entity" resulted in a string but the field is numeric. Use ToNumber(...) if this is correct. (Expression #1)

hydrogurl01
8 - Asteroid

You can put a ToNumber() formula before both the Entity and Account fields, however it doesn't seem like you will be performing any arithmetic calculations off of this field. Is your New Entity field type set to a String or a Double? If it's set to a Double right now, please change it to a String within the formula tool itself.

jrgreen
7 - Meteor

That fixed it the error. I am heading home for today and I'll try to see if I can get this workflow to do what I need it to do. Thanks for all the help, you rock!

hydrogurl01
8 - Asteroid
Perfect!! Glad that fixed the error =). If you have any questions it's definitely helpful to attach your workflow to the post. Makes it a lot easier to troubleshoot by letting anyone here work through your actual workflow.

In case you're unfamiliar with saving your packaged workflow, you can save it by going to Option > Export Workflow. Be sure to select everything that appears in the window and save your workflow from there. This allows the saved package workflow to be sent to others or posted here with the saved data sources/files you are using in your workflow. More info on this can be found here: https://community.alteryx.com/t5/Alteryx-Knowledge-Base/Export-Workflows-with-Attachments-Assets/ta-...
Labels
Top Solution Authors