Re: Witango-Talk: One for the Math Gurus
Use the MODULO function to get the remainder. r = QTY % 12 Along with the quotient. q = QTY / 12 (q * 26.00) + ( {lookup what the price is for r items} ) Beverly On 10/17/08 9:17 AM, WebDude [EMAIL PROTECTED] wrote in whole or in part: Having a hard time wrapping my head around this one. Any help would be appreciated. Let's say we have bottles of perfume for sale. For shipping, we can fit 12 bottles into a box. Each box is sent separately via a courrier. The courrier charges x amount for each box plus weight. To make a long story shorter, in this scenario, we have different charges for quantities of bottles within a box. So, for a specific zone, we charge like so... QuantityPrice 1 $14.50 2 $15.50 3 $16.50 4 $18.50 5 $18.75 6 $19.00 7 $20.00 8 $21.00 9 $22.00 10 $23.00 11 $25.00 12 $26.00 Now the problem is the thirteenth bottle. We need to charge 26.00 + 14.50. 14th bottle would be 26.00 + 15.50. 15th bottle would be 26.00 + 16.50, etc. And to continue following this format... 24 bottles would be 26.00 + 26.00 25 bottles would be 26.00 + 26.00 + 14.50 26 bottles would be 26.00 + 26.00 + 15.50 27 bottles would be 26.00 + 26.00 + 16.50, etc. There is a formula in there somehow, but I am having a devil of a time trying to figure it out. Any help would be appreciated. Thanks! TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
Re: Witango-Talk: One for the Math Gurus
You count the full cases first,multiply by case price, then add the value associated with the remainder. Sent from my iPhone On Oct 17, 2008, at 8:17, WebDude [EMAIL PROTECTED] wrote: Having a hard time wrapping my head around this one. Any help would be appreciated. Let's say we have bottles of perfume for sale. For shipping, we can fit 12 bottles into a box. Each box is sent separately via a courrier. The courrier charges x amount for each box plus weight. To make a long story shorter, in this scenario, we have different charges for quantities of bottles within a box. So, for a specific zone, we charge like so... QuantityPrice 1 $14.50 2 $15.50 3 $16.50 4 $18.50 5 $18.75 6 $19.00 7 $20.00 8 $21.00 9 $22.00 10 $23.00 11 $25.00 12 $26.00 Now the problem is the thirteenth bottle. We need to charge 26.00 + 14.50. 14th bottle would be 26.00 + 15.50. 15th bottle would be 26.00 + 16.50, etc. And to continue following this format... 24 bottles would be 26.00 + 26.00 25 bottles would be 26.00 + 26.00 + 14.50 26 bottles would be 26.00 + 26.00 + 15.50 27 bottles would be 26.00 + 26.00 + 16.50, etc. There is a formula in there somehow, but I am having a devil of a time trying to figure it out. Any help would be appreciated. Thanks! TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
RE: Witango-Talk: One for the Math Gurus
Sorry if I am dense, Beverly, but I am not able to get this to work. It kind of half works. Here is what I am doing... @ASSIGN r @CALC '@ARG QTY % 12' @ASSIGN q @CALC '@ARG QTY / 12' @CALC (@VAR q * 26.00) + ( This is a search for @VAR r which returns the @COLUMN shipcost.price ) Now, if I plug in the number 1 (quantity 1) This would look like this... R = 1 Q = 0.0833 Thus I get... 0.0833 * 26.00 + (14.50) = 16.7 Answer should be 14.50 And if plug in the number 13 (quantity 13) I get... R = 1 Q = 1.08 Thus I get... 1.08 * 26.00 + (14.50) = 42.6 Answer should be 40.50 John Muldoon Corporate Incentives 3416 Nicollet Ave S Minneapolis, MN 55408-4552 612.822. [EMAIL PROTECTED] http://cipromo.com -Original Message- From: Beverly Voth [mailto:[EMAIL PROTECTED] Sent: Friday, October 17, 2008 8:47 AM To: witango-talk@witango.com Subject: Re: Witango-Talk: One for the Math Gurus Use the MODULO function to get the remainder. r = QTY % 12 Along with the quotient. q = QTY / 12 (q * 26.00) + ( {lookup what the price is for r items} ) Beverly On 10/17/08 9:17 AM, WebDude [EMAIL PROTECTED] wrote in whole or in part: Having a hard time wrapping my head around this one. Any help would be appreciated. Let's say we have bottles of perfume for sale. For shipping, we can fit 12 bottles into a box. Each box is sent separately via a courrier. The courrier charges x amount for each box plus weight. To make a long story shorter, in this scenario, we have different charges for quantities of bottles within a box. So, for a specific zone, we charge like so... QuantityPrice 1 $14.50 2 $15.50 3 $16.50 4 $18.50 5 $18.75 6 $19.00 7 $20.00 8 $21.00 9 $22.00 10 $23.00 11 $25.00 12 $26.00 Now the problem is the thirteenth bottle. We need to charge 26.00 + 14.50. 14th bottle would be 26.00 + 15.50. 15th bottle would be 26.00 + 16.50, etc. And to continue following this format... 24 bottles would be 26.00 + 26.00 25 bottles would be 26.00 + 26.00 + 14.50 26 bottles would be 26.00 + 26.00 + 15.50 27 bottles would be 26.00 + 26.00 + 16.50, etc. There is a formula in there somehow, but I am having a devil of a time trying to figure it out. Any help would be appreciated. Thanks! __ __ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
Re: Witango-Talk: One for the Math Gurus
I think you have to do this: @ASSIGN q @CALC 'floor(@ARG QTY / 12)' Brian Humes Director, Interactive JohnsonRauhoff 269-428-9257 (direct) 269-428-3377 (main) 269-428-3312 (fax) www.johnson-rauhoff.com [EMAIL PROTECTED] On Oct 17, 2008, at 10:50 AM, WebDude wrote: Sorry if I am dense, Beverly, but I am not able to get this to work. It kind of half works. Here is what I am doing... @ASSIGN r @CALC '@ARG QTY % 12' @ASSIGN q @CALC '@ARG QTY / 12' @CALC (@VAR q * 26.00) + ( This is a search for @VAR r which returns the @COLUMN shipcost.price ) Now, if I plug in the number 1 (quantity 1) This would look like this... R = 1 Q = 0.0833 Thus I get... 0.0833 * 26.00 + (14.50) = 16.7 Answer should be 14.50 And if plug in the number 13 (quantity 13) I get... R = 1 Q = 1.08 Thus I get... 1.08 * 26.00 + (14.50) = 42.6 Answer should be 40.50 John Muldoon Corporate Incentives 3416 Nicollet Ave S Minneapolis, MN 55408-4552 612.822. [EMAIL PROTECTED] http://cipromo.com -Original Message- From: Beverly Voth [mailto:[EMAIL PROTECTED] Sent: Friday, October 17, 2008 8:47 AM To: witango-talk@witango.com Subject: Re: Witango-Talk: One for the Math Gurus Use the MODULO function to get the remainder. r = QTY % 12 Along with the quotient. q = QTY / 12 (q * 26.00) + ( {lookup what the price is for r items} ) Beverly On 10/17/08 9:17 AM, WebDude [EMAIL PROTECTED] wrote in whole or in part: Having a hard time wrapping my head around this one. Any help would be appreciated. Let's say we have bottles of perfume for sale. For shipping, we can fit 12 bottles into a box. Each box is sent separately via a courrier. The courrier charges x amount for each box plus weight. To make a long story shorter, in this scenario, we have different charges for quantities of bottles within a box. So, for a specific zone, we charge like so... QuantityPrice 1 $14.50 2 $15.50 3 $16.50 4 $18.50 5 $18.75 6 $19.00 7 $20.00 8 $21.00 9 $22.00 10 $23.00 11 $25.00 12 $26.00 Now the problem is the thirteenth bottle. We need to charge 26.00 + 14.50. 14th bottle would be 26.00 + 15.50. 15th bottle would be 26.00 + 16.50, etc. And to continue following this format... 24 bottles would be 26.00 + 26.00 25 bottles would be 26.00 + 26.00 + 14.50 26 bottles would be 26.00 + 26.00 + 15.50 27 bottles would be 26.00 + 26.00 + 16.50, etc. There is a formula in there somehow, but I am having a devil of a time trying to figure it out. Any help would be appreciated. Thanks! _ _ __ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/ maillist.taf __ __ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf __ __ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
RE: Witango-Talk: One for the Math Gurus
Okay, I got it working halfway using this... @ASSIGN r @CALC EXPR='@ARG quantity%12' @ASSIGN q @CALC EXPR='@ARG quantity/12' PRECISION=0 @CALC EXPR=(@VAR q * 26)+(@COLUMN 'shippingprice.price') PRECISION=2 It calculates correctly until you try any of the following quantities... 6 through 11 18 through 23 30 through 35 Etc. Makes sense, though because of the @CALC EXPR='@ARG quantity/12' PRECISION=0 will always round up. Wasn't there a floor that would help with this? -Original Message- From: WebDude [mailto:[EMAIL PROTECTED] Sent: Friday, October 17, 2008 9:51 AM To: witango-talk@witango.com Subject: RE: Witango-Talk: One for the Math Gurus Sorry if I am dense, Beverly, but I am not able to get this to work. It kind of half works. Here is what I am doing... @ASSIGN r @CALC '@ARG QTY % 12' @ASSIGN q @CALC '@ARG QTY / 12' @CALC (@VAR q * 26.00) + ( This is a search for @VAR r which returns the @COLUMN shipcost.price ) Now, if I plug in the number 1 (quantity 1) This would look like this... R = 1 Q = 0.0833 Thus I get... 0.0833 * 26.00 + (14.50) = 16.7 Answer should be 14.50 And if plug in the number 13 (quantity 13) I get... R = 1 Q = 1.08 Thus I get... 1.08 * 26.00 + (14.50) = 42.6 Answer should be 40.50 John Muldoon Corporate Incentives 3416 Nicollet Ave S Minneapolis, MN 55408-4552 612.822. [EMAIL PROTECTED] http://cipromo.com -Original Message- From: Beverly Voth [mailto:[EMAIL PROTECTED] Sent: Friday, October 17, 2008 8:47 AM To: witango-talk@witango.com Subject: Re: Witango-Talk: One for the Math Gurus Use the MODULO function to get the remainder. r = QTY % 12 Along with the quotient. q = QTY / 12 (q * 26.00) + ( {lookup what the price is for r items} ) Beverly On 10/17/08 9:17 AM, WebDude [EMAIL PROTECTED] wrote in whole or in part: Having a hard time wrapping my head around this one. Any help would be appreciated. Let's say we have bottles of perfume for sale. For shipping, we can fit 12 bottles into a box. Each box is sent separately via a courrier. The courrier charges x amount for each box plus weight. To make a long story shorter, in this scenario, we have different charges for quantities of bottles within a box. So, for a specific zone, we charge like so... QuantityPrice 1 $14.50 2 $15.50 3 $16.50 4 $18.50 5 $18.75 6 $19.00 7 $20.00 8 $21.00 9 $22.00 10 $23.00 11 $25.00 12 $26.00 Now the problem is the thirteenth bottle. We need to charge 26.00 + 14.50. 14th bottle would be 26.00 + 15.50. 15th bottle would be 26.00 + 16.50, etc. And to continue following this format... 24 bottles would be 26.00 + 26.00 25 bottles would be 26.00 + 26.00 + 14.50 26 bottles would be 26.00 + 26.00 + 15.50 27 bottles would be 26.00 + 26.00 + 16.50, etc. There is a formula in there somehow, but I am having a devil of a time trying to figure it out. Any help would be appreciated. Thanks! __ __ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
RE: Witango-Talk: One for the Math Gurus
Thanks everyone for your help... I got it working... @ASSIGN q '@CALC EXPR=floor(@ARG quantity/12) PRECISION=0' @ASSIGN r '@CALC EXPR=@ARG quantity%12' @CALC EXPR=(@VAR q * 26)+(@COLUMN 'shippingprice.price') PRECISION=2 TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf