formula (currency) Case When to get the year to da...
# ask-stanley-ai
n
formula (currency) Case When to get the year to date amount in a a saved search
c
AI generated answer (using internal Slack threads):
Based on the conversations, to get the year to date amount in a saved search, you can use a Formula (Currency) field with a case statement. Here is an example of how you can set it up: 1. Go to Reports > Saved Searches > All Saved Searches > New. 2. Choose the record type for your search. 3. Enter a name for your search. 4. Under the Criteria tab, set your desired filters. For example, you might want to filter for specific transaction types and ensure that 'Main Line' is true. 5. Under the Results tab, add the fields you want to display. For the year to date amount, you can add a Formula (Currency) field with the following formula:
Copy code
CASE WHEN TO_CHAR({transaction.trandate},'YYYY')=TO_CHAR({today},'YYYY') AND {transaction.trandate}<={today} THEN {transaction.amount} ELSE 0 END
This formula checks if the transaction date is in the current year and before or on the current date. If it is, it returns the transaction amount; otherwise, it returns 0. 6. Set the Summary Type of the formula field to 'Sum' to get the total amount for the year to date. 7. Save and run your search. Please note that you might need to adjust the formula and other search settings to fit your specific needs. ****** 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.846995831
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84607017
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.845689714
Please provide your feedback on this answer.