Trying to sum the location quantity available for ...
# general
m
Trying to sum the location quantity available for multiple locations as a formula on an item saved search (not to use summary type for the results) - tried formula
(CASE WHEN {inventorylocation} = '1' THEN {locationquantityavailable} ELSE 0 END) + (CASE WHEN {inventorylocation} = '2' THEN {locationquantityavailable} ELSE 0 END)
however not adding together - any idea why? also the output I need is - as part of the criteria I've selected the multiple locations and currently they are displaying over multiple lines hence want to display as a sum on one line however it still appears as multiple...
d
without doing a summary search, you've only really got one option, which is to use the trick to execute analytic functions in formulas. See here for an example. Definitely an advanced, unsupported method that requires knowledge for SQL queries. something to the tune of:
SUM/*comment*/(CASE WHEN {inventorylocation} IN (1,2) THEN {locationquantityavailable} END) OVER (PARTITION BY {internalid})