Skip to content

orangelint/todays-sales-grafana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 

Repository files navigation

today's sales data

A guide to creating grafana graphs that display current day sales and remaining forecast.

assumptions

  1. you have a grafana instance running
  2. data sources that host your sales totals are added to your running grafana instance

add a blank graph

after logging into grafana, on left hand side click "+", then "Add new panel"

grafana will immediately plot some data using its own embedded default data source (just to make you feel good)

import today's sales into the graph

replace the default datasource with the datasource hosting your sales data.

  • In our example:
    metrics-frontdoor

replace the default query with the query that extracts your sales data.

  • In our example:
    SELECT mean("Stores_Sales_Cafe_Level2") FROM "Task_mips_store" WHERE ("_blossom_id" = 'CI02838708') AND $timeFilter GROUP BY time($__interval) fill(null)

import today's forecasted sales into the graph

add another query (same datasource) that uses xgboost to forecast the remainder of the day

  • In our example:
    SELECT FORECAST(mean("Stores_Sales_Cafe_Level2"), 'xgb', 24h, 3) FROM "Task_mips_store" WHERE ("_blossom_id" = 'CI02838708') AND time > now() - 4d GROUP BY time(5m) fill(null)

label and color the sales datasets

On upper right of your dashboard, expand "Show options" feature and update the following:

-Under "Settings", click "show options", add a title to your panel: "WIDGETS"

-Under "Display", set "Null value" to "connected"

-Under "Series Overrides", add "Change Color" to "widgets" (select white).

-Under "Series Overrides", add "Change Color to "forecast (select orange).

Your sales data now is complete and connected with today's forecast finishing the day

zoom out your sales data (for funzies!)

click on the date picker in the upper right hand corner and set timings to 12 hours in past, and 12 hours in future.

tada! now you have a 24 hour chart of past and projected sales!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published