I made an item search that brings in inventory dat...
# suiteanalytics
g
I made an item search that brings in inventory data from two inventory locations. To get the total available for the two locations, I added "Location Available" and have applied the "Sum" summary type to the field. I want to be able to have another results column that outputs a specific text value if that sum is >= 5 AND some other field (checkbox) is true - but I can't seem to get it to work.
n
what's your current formula?
g
I had
case when {checkboxfield} = 'T' and {locationquantityavailable} >= 5  then 'whatever' else 'whatever2' end
and it "works" but the accuracy is questionable. I want to look at the total available for both locations, and that formula doesn't do that. So I could have 4 at one location, and 2 at the other, and that formula wouldn't output the correct text.
I tried wrapping the
{locationquantityavailable}
in
sum()
and netsuite didn't like that.
n
I started with Formula (text), Summary Type Maximum, CASE WHEN SUM({locationquantityavailable}) > 5 THEN 'A' ELSE 'B' END. This part works
CASE WHEN {checkboxfield} = 'T' THEN 'A' ELSE 'B' END also works. but when we try to add the two into one forumla is the issue:
I didn't expect DECODE({custitem_monthly_averages_updated},CASE WHEN SUM({locationquantityavailable}) > 5 THEN 'A' ELSE 'B' END,'C') would work, and it didn't
tried CASE WHEN {checkboxfield} = 'T' THEN CASE WHEN SUM({locationquantityavailable}) > 5 THEN 'A' ELSE 'B' END ELSE 'C' END - also didn't work
any chance you can put {checkboxfield} = 'T' in the search Criteria?
a
If your going to use the SUM() function then all variables in your formula need to have an aggregation function for it to work. Also it only works when the summary type is min or max on the formula Try this Field Formula(text) Summary = Maximum CASE WHEN SUM{locationquantityavailable}) > MAX(5) AND MAX({checkbox}) = MAX(‘T’) THEN MAX(‘yourtexthere’) END
g
@Netsuite Tragic @AI1 Thank you both for your help! This is what ended up working for me:
CASE WHEN SUM{{locationquantityavailable}) >= 5 AND MAX({checkbox}) = MAX('T') THEN 'this text' else 'other text' END
It was the
Max('T')
that was missing in my attempts...I had tried without it and it wasn't working....would never have thought to try that.
n
Thanks for posting this initial question @Gregory Jones and the extra focus @AI1