Item Search, Criteria: CASE WHEN (NVL({locationqua...
# administration
m
Item Search, Criteria: CASE WHEN (NVL({locationquantityavailable}, 0) <= 0 AND {inventorylocation} = 'test1' ) AND (NVL({locationquantityavailable}, 0) <= 0 AND {inventorylocation} = 'test2') THEN 1 ELSE 0 END if one of these locations is empty on the inventory table, this criteria will filter out the product. as if NVL is not working. Can NVL not be used in criteria like this?
b
CASE WHEN 0 <= 0 AND {inventorylocation} = 'test1' ) AND 0 <= 0 AND {inventorylocation} = 'test2') THEN 1 ELSE 0 END
simplifies to
CASE {inventorylocation} = 'test1' AND {inventorylocation} = 'test2' THEN 1 ELSE 0 END
m
Hey @battk, I am not sure I am catching your drift. Are you saying my formula is no good?
b
you need to be able to tell how useful
CASE {inventorylocation} = 'test1' AND {inventorylocation} = 'test2' THEN 1 ELSE 0 END
is
m
The formula is simply for filtering out items which may be in-stock somewhere. I want, in my results, items which are not in-stock across a few specific locations. Hence trying to NVL(inventory).
b
thats not your problem
m
Because the location may have a value, or not.
b
inventorylocation
cant be 2 different values at once
m
If both the locations contain a value, the formula works fine. So, I think in this scenario, it can?
b
make your formula not involve
locationquantityavailable
and try it out
m
Well, in that scenario, I would just put criteria of inventory location = those locations.
(not in a formula)
b
do the formula anyways
m
I guess it wouldn't make sense.
b
again, my statment remains:`inventorylocation` cant be 2 different values at once
if you think it can, my recommendation is making a formula to confirm that information for yourself
m
So, I broke it into two separate criterias: CASE WHEN (NVL({locationquantityavailable}, 0) <= 0 AND {inventorylocation} = 'test1' ) THEN 1 ELSE 0 END (for both locations) the search works as expected. However, if one location has null inventory - the item will not appear in the results.
b
not sure how you implemented your search criteria
your description of
for both locations
is not really enough to tell what you did with your search criteria
m
new criteria line of that formula for 1 location.
a 2nd criteria line with the same formula, but a different location
b
are you using expressions?
m
Thanks for the help battk. I tried this like 50 different ways. End result seems like you are correct. NetSuite won't allow what I am trying to do. Adjust the search and will just filter the rest via script.