Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Announcement | We'll be doing maintenance between 2-3 hours, which may impact your experience. Thanks for your patience as we work on improving the community!
Free Trial

Alteryx Designer Desktop Discussions

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

Tool Mastery | Multi-Field Formula

ymajid
5 - Atom

I'm trying to write a formula using 2 columns of data as well whole numbers.

 

Example)

 

Fields I'm using: Gross Revenue, Commission Rate

 

Trying to calc ("Gross revenue" *(1-"Commission Rate"))*12

 

Error message: "Formula: invalid type in subtraction operator"

 

Am I entering the formula incorrectly? Please advise. Thank you in advance!!

5 REPLIES 5
NicoleJohnson
ACE Emeritus
ACE Emeritus
Hi!
Try wrapping ToNumber() around the fields containing numbers in your formula, or placing a Select tool in front of the Formula tool and changing those fields used in number calculations to a number type. That should help!

(ToNumber([Gross Revenue])*(1-ToNumber([Commission Rate])))*12

NJ
ymajid
5 - Atom

Hi Nicole!

 

Thank you for your insight!! I think I've almost got it but I'm stuck on one more issue...now I'm getting an error that reads "The field "" is not contained in the record. (expression #1)". Could this have to do with the data in the columns "Gross Revenue" and "Commission Rate"? 

 

NicoleJohnson
ACE Emeritus
ACE Emeritus
Nope, that particular issue means that you didn't give a name to your new field in the formula tool :) Add a name in the name field (in the upper left corner of the formula section you're working in) - you can either give your field a new name or click an existing field to replace its contents with the formula you've created!

NJ
ymajid
5 - Atom

That worked perfectly - thank you SO much!!

NotQuiteClueless
7 - Meteor

That's been bugging me for the last couple of days. Many thanks

Labels
Top Solution Authors