Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Creating a loop/iterative calculation

randaya
5 - Atom

Hi,

 

Can someone help recreate the below excel formula in Alteryx please?

 

i'd like to create a formula (loop/iteration) where Gross sales = Net Sales + tax but the only number I have is the Net sales and the tax rates. 

 

 Sample 1Sample 2CommentsExcel formula
Net sales  10,000.00     25,000.00Given inputXXX [Entry]
tax    1,764.71       9,722.22Calculated (Gross sales * tax brackets)(Gross sales)*VLOOKUP((Gross sales),tax rates table,tax rate column)
Gross sales  11,764.71     34,722.22Calculated sum of net sales and tax bracketsNet sales + Tax
     
 15% rate28% rate  

 

Tax rates table below for reference:

 

Gross Sales levelTax rate
010.00%
10,00115.00%
20,00125.00%
30,00128.00%


Thanks in advance!

2 REPLIES 2
jdunkerley79
ACE Emeritus
ACE Emeritus

I attach a solution.

 

Basically, I compute the equivalent Net Sales Level to the threshold for Gross. Please note that there is overlap in how you have described the system, around boundaries as when you jump up the tax paid jumps up. My approach will assume you pay most tax possible.

 

You then add a record ID to the sales data and then append the fields to join sets. Next use a sample tool to pick active tax level. You can then compute tax.

 

randaya
5 - Atom

Great, thanks! This helps. 

 

Now to add to the complication, can you take a look at the attached workflow. This is a simple tax calculator but I'd like to build similar to what you've indicated. The tax brackets now here is not as straightforward.

 

What I build is just the straightforward calculator. Now, I wanted to have the net sales add the tax and calculate the tax based on gross sales (net sales + tax). I've tried what you've suggested but I'm struggling to come up with the formula in case the rate changes. For example, see employee 7. Net sales is 200,000 which is at 29% rate if doing a straight up calculation. However, it will be at 33% if adding the tax on it. 

 

Thanks in advance!

Labels