function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jarrodmichaeljarrodmichael 

How to check for a % change on a number field in a given time frame

I am trying to create some logic that will alert an internal group if a number field "Cards Available" changes by a certain % in different given time frames (1 day, 2 weeks, etc.).

 

For example:

If over the course of 2 weeks, the numbers of cards available decrease by more than 15% can it trigger an email alert.

Ispita_NavatarIspita_Navatar

You can have rules or business logic to solve this problem.

For example you can have a formula field for__c which has the following formula:-

// assuming the field to be changed is x__C

If  ( ( DateOfCreation- Today> 7)( if ( (Priorvalue(x___c)/x___c) *100)> 15, 1,0),(other logic))

 

Then you can have a workflowfule which triggers when value of x___c changes to 1 and in the action you can send at email alert.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
 

jarrodmichaeljarrodmichael

Thanks for the help!

 

This is what I put in:

If  ( (  CreatedDate - Today> 7)( if ( (Priorvalue( Cards_Available__c )/Cards_Available__c ) *100)> 15, 1,0),( CASE( Status__c , "In Production", 1, "Active", 1, "Obsolete Still in Sale", 1, 0) =1))

 

SF tells me I am missing a ")", although I cannot seem to find where I am missing it at.  Can you take a look and let me know if you see it?

 

Thanks!