Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Module7.md #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions cosmosdb-adx-integration/LabModules/Module7.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,24 @@ You can also use Kusto explorer which is a desktop edition similar to the Web UI
### Glimpse of advanced native features like time series analysis, forecasting and anomaly detection
- This query forecasts the next week sales using time series decomposition on historical data
```
let min_t = datetime(2020-06-01);
let max_t = datetime(2020-07-01);
let dt = 1d;
let horizon=7d;
NrtaLabTable
| project Timestamp, Action
| where Timestamp between(min_t .. max_t)
| where Action == "Purchased"
| make-series Purchases=count() on Timestamp from min_t to max_t+horizon step dt
| extend forecast = series_decompose_forecast(Purchases, toint(horizon/dt))
| render timechart with(title='forecasting the next week sales by Time Series Decmposition')
let min_t = datetime(2020-06-01);
let max_t = datetime(2020-07-01);
let dt = 1d;
let horizon=7d;
NrtaLabTable
| project Timestamp, Action
| where Action == "Purchased"
| make-series Purchases=count() on Timestamp from min_t to max_t+horizon step dt
| extend forecast = series_decompose_forecast(Purchases, toint(horizon/dt))
| render timechart with(title='forecasting the next week sales by Time Series Decmposition')
```
- This query finds anomalies in the purchase of jackets for a specific duration
```
NrtaLabTable
| where Timestamp between(datetime(2020-05-01) .. datetime(2020-06-15))
| where Action == "Purchased"
| where Item has 'Jacket'
| make-series Purchases=count() on Timestamp in range(datetime(2020-05-01), datetime(2020-06-15),7d)
| extend anomalies = series_decompose_anomalies(Purchases, 2)
| render anomalychart with(anomalycolumns=anomalies, title='Anomalies in purchase of jackets')
NrtaLabTable
| make-series Purchases=avg(Price) on Timestamp from datetime(2020-05-01) to datetime(2020-06-15) step 1d by Action
| where Action == "Purchased"
| extend anomalies = series_decompose_anomalies(Purchases, 2)
| render anomalychart with(anomalycolumns=anomalies, title='Anomalies in purchase of items')
```

### Build a dashboard using ADX Dashboards with above mentioned queries
Expand Down