Skip to main content

Hi,

 

Trying to build out a GI and needing some help on an IF statement.

 

Here’s the scenario. 

 

If the Lot/Serial class is ‘LOTTED’, then the Lot/Serial Nbr. column should be ‘green’ for ‘LOTTED’ items where it is not empty and ‘red’ for ‘LOTTED’ items that are empty. If it is not LOTTED, then it should be ‘default’.

 

If the Lot/Serial Class is ‘DEFAULT’, the QTY Remaining column should be ‘green’ if QTY Remaining > QTY on Hand and should be ‘red’ if QTY Remaining < QTY on Hand. If it is LOTTED, then it should be ‘default’ in this column.

 

Here are my existing formulas in the respective fields:

QTY Remaining:

=IIf( eAMProdMatl.QtyReq] > RINSiteStatusSummary.QtyOnHand], 'bad', 'good' )

 

Lot/Serial Nbr:

=IIf(oAMProdItem.LotSerialNbr]= Null,'bad', 'good' )

 

 

 

Hi @jwarren! Have you already tried using just ‘’ instead of null?

So like =IIf(=AMProdItem.LotSerialNbr]= ‘’,'bad', 'good' )


Hi @jwarren! Have you already tried using just ‘’ instead of null?

So like =IIf(AMProdItem.LotSerialNbr]= ‘’,'bad', 'good' )

The IF statements themselves are working - what I’m trying to do is for lines 3 and lines 4 in my screenshot, since these are Lot Class = DEFAULT, there should be no style (neither green or red) it should be the default style in Lot/Serial column. Vice versa for lines 1 and 2 - there should be no style in the QTY remaining column when it is LOTTED Class.


@jwarrenCan you post the GI XML? You’re going to need nested IIfs for both fields, if I am reading your posts correctly.


@jwarrenCan you post the GI XML? You’re going to need nested IIfs for both fields, if I am reading your posts correctly.

I believe you are correct. Here is an export of the results grid for the GI. 


@jwarren 

This should do it. You just turn the “else” into a second if statement which I think is what everyone else is saying. 

Replace the field captions with the actual field mapping and this should work fine.

Lot/Serial Class Color = iif(=Lot/Serial Class] = ‘LOTTED’, ‘default’, iif(fQTY Remaining] > mQty on Hand], ‘good’, ‘bad’))

 


Reply