suiteql query to get quanaityavailable in location...
# ask-stanley-ai
k
suiteql query to get quanaityavailable in locations
c
AI generated answer (using internal Slack threads):
To get the
quantityavailable
in locations using SuiteQL, you can join the item to the
aggregateItemLocation
. However, please note that
quantityavailable
is not directly exposed in the query. Here is a general idea of how you might structure your query:
Copy code
sql
SELECT item, SUM(quantityavailable)
FROM aggregateItemLocation
GROUP BY item
Please replace
item
and
quantityavailable
with the actual field names in your database. If you are trying to sum the location quantity available for multiple locations as a formula on an item saved search, you can use the trick to execute analytic functions in formulas. Here is an example:
Copy code
sql
SUM/*comment*/(CASE WHEN {inventorylocation} IN (1,2) THEN {locationquantityavailable} END) OVER (PARTITION BY {internalid})
This will sum the
locationquantityavailable
for inventory locations 1 and 2, partitioned by the
internalid
. If you want to create a saved search from UI to get quantity available for all the items for a particular inventory location only, you can use 'Location Available' in the results rather than 'Available', and filter on 'Location'. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837890506
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.802124
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.802063
Please provide your feedback on this answer.