formula (currency) Case When to get the last year ...
# ask-stanley-ai
n
formula (currency) Case When to get the last year date amount in a saved search not the last year amount
c
AI generated answer (using internal Slack threads):
Based on the conversations, to get the last year date amount in a saved search, you can use a formula (currency) with a CASE WHEN statement. The formula would look something like this:
Copy code
CASE WHEN TO_CHAR({transaction.trandate},’YYYY’)=TO_CHAR({today},’YYYY’)-1 THEN {transaction.amount} ELSE 0 END
This formula checks if the year of the transaction date is equal to the current year minus one (which would be last year). If it is, it returns the transaction amount. If it's not, it returns 0. Please note that you need to ensure that the fields in the formula match the fields in your saved search. Also, make sure there are no spaces in the field names (like
{to day}
), as this can cause errors. ****** 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.837752104
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836159825
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835999727
Please provide your feedback on this answer.