Alteryx Designer Desktop Discussions

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

Dividing cost evenly makes total larger then initial cost

oneillp111
9 - Comet

I am working on dividing a shipping charge against number of items shipping. In this case I have a $33 shipping charge and 8 parts.  33/8 = 4.125 or $4.13.  Now if I distribute that against each part it results in $33.04 as a total.  Is there another function I can use to determine the even distribution, leaving more or less in the other 

 

 

CostExample.pngCostExample2.png

3 REPLIES 3
mceleavey
17 - Castor
17 - Castor

Hi @oneillp111 ,

 

This is a simple rounding issue caused by the round up of 4.125 to 4.13 so it depends what you're trying to achieve.

You can use the Floor function to round the figure down so as not to go over the total shipping amount, and then leave you with a remainder. This means you can assign the remainder to, for example, one of the shipment fees with the rest being taken from the calculation:

 

mceleavey_1-1638384850071.png

 

Without seeing your data structure and what you're trying to do, this might get you started.

 

Hope this helps,

 

M.

 

 

 

 

 

 



Bulien

oneillp111
9 - Comet

@mceleavey 

 

This works for what I need.  I appreciate the response.  Thanks for the assist

mceleavey
17 - Castor
17 - Castor

no problem.gif



Bulien

Labels