
Re: Complicated situation for Lookup function
Sunny Talwar Sep 13, 2017 11:57 AM (in response to Mike Grattan)Not completely sure, but you can use Mod function to find if the number is whole number or not
If(Mod(Number1, Number2) = 0, 'whole pallet', 'Incomplete pallet')

Re: Complicated situation for Lookup function
Mike Grattan Sep 13, 2017 12:08 PM (in response to Sunny Talwar )Thank you for the response Sunny.
I think I should clarify my question. If the number of cartons is greater than Cartons To Pallet and it is evenly divisible by Cartons To Pallet (but not necessarily just a whole number).
For example: If there are 112 cartons on the order and Cartons To Pallet for that item number is 56, then there are two full pallets on the order. If the number of cartons is 150, then there is one full pallet and one partial pallet. Since one pallet was "picked", then the pick flag would be 1 for that item number.
Is there a way to write my IF statement so that it accommodates both the situation where the number of cartons is less than the Cartons To Pallet value, but could also be greater than that number if it is evenly divisible by Cartons To Pallet?

Re: Complicated situation for Lookup function
Sunny Talwar Sep 13, 2017 12:14 PM (in response to Mike Grattan)Which part of your expression is number of cartons and which one is Cartons To Pallet here?
UNITS < Lookup('CartonsToPallet','ItemNumber',ITEMNUM,'ItemDescriptions')
Is UNITS number of cartons? and Lookup Cartons to Pallet?

Re: Complicated situation for Lookup function
Mike Grattan Sep 13, 2017 12:17 PM (in response to Sunny Talwar )Correct; UNITS is number of cartons and I am using the Lookup function to get CartonsToPallet.

Re: Complicated situation for Lookup function
Sunny Talwar Sep 13, 2017 12:27 PM (in response to Mike Grattan)May be this
If(UNITS < Lookup('CartonsToPallet','ItemNumber',ITEMNUM,'ItemDescriptions') or
Mod(UNITS, Lookup('CartonsToPallet','ItemNumber',ITEMNUM,'ItemDescriptions')) <> 0,1,0) AS PickFlag

Re: Complicated situation for Lookup function
Mike Grattan Sep 13, 2017 12:32 PM (in response to Sunny Talwar )That's probably on the right track but doesn't account for the UNITS being evenly divisible by CartonsToPallet. I wonder if it would work like this:
If(UNITS < Lookup('CartonsToPallet','ItemNumber',ITEMNUM,'ItemDescriptions') or
Mod(UNITS / Lookup('CartonsToPallet','ItemNumber',ITEMNUM,'ItemDescriptions')) <> 0,1,0) AS PickFlag
Can I divide UNITS by the lookup value and test the MOD of that?

Re: Complicated situation for Lookup function
Sunny Talwar Sep 13, 2017 12:36 PM (in response to Mike Grattan)Mod is checking for remainder ... You don't need to use /...

Re: Complicated situation for Lookup function
Mike Grattan Sep 13, 2017 12:38 PM (in response to Sunny Talwar )So MOD is doing division by CartonsToPallet? Cool....I will test and get back to you!

Re: Complicated situation for Lookup function
Sunny Talwar Sep 13, 2017 12:40 PM (in response to Mike Grattan)




Re: Complicated situation for Lookup function
Mike Grattan Sep 13, 2017 1:40 PM (in response to Sunny Talwar )Works perfectly. Thanks!




