Nada Ahmed
08/25/2024, 1:48 PMCeligo AI
08/25/2024, 1:48 PMAI generated answer (using internal Slack threads):To get the last year, year to date amount in a saved search, you can use a formula (currency) with a case when statement. Here is an example of how you can do it: 1. Create a new saved search and choose the appropriate record type (e.g., Transaction). 2. Under the Criteria tab, set the necessary filters. For example, you might want to filter by Transaction Type and Main Line. 3. Under the Results tab, add the following fields: - Name with Summary Type = Group. - Formula (Currency) with Summary Type = Sum and Custom Label = Sales Last Year:
CASE WHEN TO_CHAR({transaction.trandate},'YYYY')=TO_CHAR({today},'YYYY')-1 THEN {transaction.amount} ELSE 0 END
- Formula (Currency) with Summary Type = Sum and Custom Label = Sales YTD:
CASE WHEN TO_CHAR({transaction.trandate},'YYYY')=TO_CHAR({today},'YYYY') AND {transaction.trandate}<={today} THEN {transaction.amount} ELSE 0 END
4. Save and Run the search.
This will give you the total amount for the last year and the year to date amount. The case when statement checks if the transaction date is within the last year or the current year and then sums up the transaction amounts accordingly.
******
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
08/25/2024, 1:48 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84573108
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844293177
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842858911
Celigo AI
08/25/2024, 1:48 PM