Solved

Help with =IIF[@BatchSize) is Null, expression

  • 6 March 2024
  • 5 replies
  • 42 views

Userlevel 2
Badge

 

 

 

I have a Batch Size that is pulling the total order quantity and resizing calculating it down to the formula amount of 180 kg batch size. I have set up a parameter for Batch Size as an option to add a custom batch size and I need help on the logic; if no Batch Size is entered into the Run Report Page then calculate the normal formula batch size. But if we add a custom batch, let's say 160 kg, then it should calculate the ingredients based upon 160 kg. I'm having a problem finding the correct operator on the IIF expression for the custom batch size.

 

 

 

 

icon

Best answer by mike2665 6 March 2024, 21:21

View original

5 replies

Userlevel 7
Badge +12

The IIF need a condition and then a true and false value so you just have it set to if Batch Size is Null then do the calculation but if it not null you have nothing set.

You are missing the Opening (  before [BatchSize] then at the end you need i believe the following

,[BatchSize])

 

If you send me the Text of your condition i can fix it.

 

 

Userlevel 2
Badge

Thank you dcomerford, here is my test.

=IIF[@BatchSize) is Null, [AMProdItem.QtytoProd] / Ceiling(([AMProdItem.QtytoProd] / [EWPMFormula.FormulaReqQty]))

Userlevel 7
Badge +12

@mike2665  I dont have your form but this should do it

=IIF([@BatchSize] is Null, [AMProdItem.QtytoProd] / Ceiling([AMProdItem.QtytoProd] / [EWPMFormula.FormulaReqQty]), [@BatchSize])

 

 

Userlevel 2
Badge

It worked if I typed in the manual batch size, but it came out blank if I did not enter a manual batch size. If I don’t type in the manual batch size then I want it to perform the standard calculation of;

=[AMProdItem.QtytoProd] / Ceiling([AMProdItem.QtytoProd] / [EWPMFormula.FormulaReqQty])

I’m trying to get an either / or answer. So if the manual batch size is blank it should do the normal calculation, but if you type in a manual batch size in the parameter it will calculate from the manual entry.

Userlevel 2
Badge

Looking at your first expression gave me an idea. I should use Is instead of IIF. this one worked. 

=IsNull([@BatchSize],[AMProdItem.QtytoProd] / Ceiling(([AMProdItem.QtytoProd] / [EWPMFormula.FormulaReqQty])))

 

Thank you for your help!!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved