Nada Ahmed
11/24/2024, 11:30 AMCeligo AI
11/24/2024, 11:30 AMAI generated answer (using internal Slack threads):The formula you provided seems to be missing an ELSE clause for the CASE WHEN statement. The corrected formula should look like this:
sql
CASE
WHEN {type} = 'Item Receipt' THEN {quantity}-{inventorydetail.quantity}
WHEN {type} = 'Bill' THEN {quantity}+{inventorydetail.quantity}
ELSE {quantity}
END
This formula will subtract the inventorydetail.quantity
from quantity
when the type
is 'Item Receipt', add the inventorydetail.quantity
to quantity
when the type
is 'Bill', and return the quantity
as is for all other types.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
11/24/2024, 11:31 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.859064579
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.853813589
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843662858
Celigo AI
11/24/2024, 11:31 AM