i want to write an sql query in an item saved sear...
# ask-stanley-ai
n
i want to write an sql query in an item saved search in the results tab so that the column shows the summation of the quantity available at a certain location
c
AI generated answer (using internal Slack threads):
To write an SQL query in an item saved search in the results tab so that the column shows the summation of the quantity available at a certain location, you can use the following formula:
Copy code
SQL
SUM/*comment*/(CASE WHEN {inventorylocation} IN (1,2) THEN {locationquantityavailable} END) OVER (PARTITION BY {internalid})
This formula uses the
SUM
function to add up the
locationquantityavailable
for the specified
inventorylocation
(in this case, locations 1 and 2). The
PARTITION BY {internalid}
clause is used to group the results by item. Please note that this method is advanced and requires knowledge of SQL queries. It's also worth mentioning that this method is not officially supported by NetSuite, so use it at your own risk. ****** 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.870143592
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.862857819
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.856705844
Please provide your feedback on this answer.