Nour Khaled
04/20/2025, 2:10 PMCeligo AI
04/20/2025, 2:10 PMAI generated answer (using internal Slack threads):Based on the provided Slack threads, it seems like you want to modify your function to filter dates between 1/1/2024 and 31/12/2024. You can achieve this by replacing the
ADD_MONTHS(SYSDATE, -12) AND SYSDATE
part of your function with the specific dates you want. Here's how you can modify your function:
sql
CASE
WHEN {type} IN ('Invoice', 'Cash Sale') AND {trandate} BETWEEN TO_DATE('01/01/2024', 'MM/DD/YYYY') AND TO_DATE('12/31/2024', 'MM/DD/YYYY') THEN {quantity}
WHEN {type} IN ('Credit Memo', 'Cash Refund') AND {trandate} BETWEEN TO_DATE('01/01/2024', 'MM/DD/YYYY') AND TO_DATE('12/31/2024', 'MM/DD/YYYY') THEN +{quantity}
ELSE NULL
END
This function will now consider only the transactions that happened between 1/1/2024 and 31/12/2024 for 'Invoice', 'Cash Sale', 'Credit Memo', and 'Cash Refund' 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
04/20/2025, 2:10 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.85393846
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84232831
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839186847
Celigo AI
04/20/2025, 2:10 PM