Rithesh had asked in Re: What alert do you want? I'll build it at TC15! whether VizAlerts could send an email out when a sum of the sales met some threshold. The answer is yes. This post shows the proof-of-concept.
First, you could simply build a viz where you filter against the SUM([Sales Amount]). Once the threshold is reached, the data will show up in your viz, and you'd get an email. But the tricky thing about these threshold alerts where the amounts only ever increase is that you would then continue to get alerts each time VizAlerts ran against your alert thereafter. If you're sending a big email out, you don't really want that!
To avoid that situation, your data must include the date and time of each sale, and how much the sale amount was. Using that information, you can construct a relative date filter against a series of table calculations that allows your viz to logically say "Show me the earliest date and time we hit our sales target, but only if it happened in the last N minutes". This way, once the next time your alert fires, that date has moved outside of your relative date window, and no subsequent alerts are sent.
This can also work for sales data that only includes the date of the sales and not the date and time , but you would be limited to a daily alert at that point--and typically you wouldn't want to wait an entire day to find out that you achieved a sales target.
The essential steps are outlined in the twbx I attached. Just go one sheet at a time to see the progression. After publishing it, you'd subscribe to an Hourly alerts schedule.
1. Create calc for running sum of sales
2. Create a parameter denoting the sales target amount
3. Create a calc that returns t/f for whether sales target was achieved
4. Create a calc showing the minimum date where the sales target was achieved
5. Do a silly calc to find the number of minutes since the minimum sales target achieved date occurred (there must be a more elegant way that avoids this, but I couldn't figure a better way out)
6. Turn the number of "minutes since sales target achieved" back into a date with another calc--this represents the date that the sales target was achieved
7. Set your relative filter on this last calculation for 60 minutes
8. Publish to Server
9. Subscribe to the last sheet on the Hourly alerts subscription schedule
SalesTargetAlert.twbx 40.8 KB