Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!

Formula for flat fee plus percentage?

8 - Asteroid

Hi there.


I'm trying to create a column that displays a platform fee for sales to specific buyers.  One buyer is a flat percentage of revenue (8%) plus a specific dollar ($20) amount while another buyer is just a flat percentage (6%). 


What would the correct formula look like? 




Alteryx Certified Partner
Alteryx Certified Partner

Hi @skeen503979 try this syntax also ensure your Data type is a numeric type like a double as the formula defaults to V_WString.


IF [Buyer Name] = "Buyer 1" then (0.8 * [Revenue]) +20 Elseif [Buyer Name] = "Buyer 2" then (0.6) * [Revenue] Else 0 Endif


I agree with the syntax of the solution above, but that formula would give you 80% +20 and 60% respectively. 


IF [Buyer Name] = "Buyer 1" then (0.08 * [Revenue]) +20 Elseif [Buyer Name] = "Buyer 2" then (0.06) * [Revenue] Else 0 Endif


Essentially, the formula is saying if the Buyer Name is Buyer 1, then use 8% of revenue + 20. If the Buyer Name is Buyer 2, then use 6% of revenue. If the Buyer Name is not Buyer 1 or Buyer 2 (essentially your catchall for the rest of the records), use 0.


Also, ensure you change the data type at the bottom of the formula to a numeric field type like Double. The default is a string (text) value.