cancel
Showing results for 
Search instead for 
Did you mean: 

Need to Stop macro when generating the first alert

Hello Gurus,

Users are complaining about the amount of alerts they get. They want to only get one alert per product-location. For instance, the stock is below the safety stock for the next 10 periods so the macro generates 10 alerts. The users want to get only one alert, that is, as soon as the macro is generated for the first period where the stock falls below the safety stock, the macro should continue with the next product-location.

Thanks in advance,

David

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member187488
Active Contributor
0 Kudos

Hi,

Similarly you can use a variable in the macro, when the alert condition meets, you set the alert and at the same time set the variable to 'X'.
The alert should only generate when the variable is not 'X'.
So anyway this should be controlled in your own macro logic.

Best Regards,
Ada

juhaszzoli
Member
0 Kudos

Hi David,

We had exactly same requirement earlier - we solved the issue by using an auxiliary cell in the macro.

So when the macro runs then it checks the normal alert condition + the value of the auxiliary cell with certain iterations.

If alert condition is met AND auxiliary cell value is blank/zero then the macro generates DB alert plus set value for auxiliary cell as "1'.

In fact the iteration still runs thru all buckets trying to create alerts - but because of the aux cell value as "1" no any additional alert is generated for that specific locprod.

Attached I am sending you the macro we are currently using.

Best Regards

Zoltán

one-aler-per-locprod.jpg