Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sales dashboard built with Banana and Solr with sample data from Kaggle https://www.kaggle.com/kyanyoga/sample-sales-data
{
"title": "Sales Dashboard",
"services": {
"query": {
"idQueue": [
1,
2,
3,
4
],
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,
"pin": false,
"type": "lucene"
}
},
"ids": [
0
]
},
"filter": {
"idQueue": [
1,
3,
4
],
"list": {
"0": {
"from": "2017-03-22T22:00:00.000Z",
"to": "2019-09-08T22:00:00.000Z",
"field": "ORDERDATE_dt",
"type": "time",
"mandate": "must",
"active": true,
"alias": "",
"id": 0
},
"2": {
"type": "range",
"from": "-1",
"to": "100",
"field": "QUANTITYORDERED_i",
"mandate": "must",
"active": true,
"alias": "",
"id": 2
}
},
"ids": [
2,
0
]
}
},
"rows": [
{
"title": "Query and Time Window",
"height": "50px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
{
"error": "",
"span": 6,
"editable": true,
"type": "timepicker",
"loadingEditor": false,
"status": "Stable",
"mode": "absolute",
"spyable": true,
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d",
"90d",
"1y",
"5y"
],
"timespan": "5y",
"timefield": "ORDERDATE_dt",
"timeformat": "",
"refresh": {
"enable": false,
"interval": 30,
"min": 3
},
"filter_id": 0,
"title": "Time Window",
"time": {
"from": "03/23/2017 00:00:00",
"to": "09/09/2019 00:00:00"
}
},
{
"span": 6,
"editable": true,
"type": "hits",
"loadingEditor": false,
"queries": {
"mode": "all",
"ids": [
0
],
"query": "q=*&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&stats=true&stats.field=QUANTITYORDERED_i&stats.field=SALES_f&stats.field=SALES_f&wt=json&rows=0\n",
"basic_query": "",
"custom": ""
},
"style": {
"font-size": "28pt"
},
"arrangement": "horizontal",
"chart": "total",
"counter_pos": "above",
"donut": false,
"tilt": false,
"labels": true,
"spyable": true,
"show_queries": true,
"metrics": [
{
"type": "mean",
"field": "QUANTITYORDERED_i",
"decimalDigits": 2,
"label": "Average Quantity",
"value": "35.09"
},
{
"type": "mean",
"field": "SALES_f",
"decimalDigits": 2,
"label": "Average Total",
"value": "3553.89"
},
{
"type": "sum",
"field": "SALES_f",
"decimalDigits": 2,
"label": "Total Sales",
"value": "10032628.85"
}
],
"refresh": {
"enable": false,
"interval": 2
},
"title": "Stats Per Order"
}
]
},
{
"title": "Filters",
"height": "50px",
"editable": true,
"collapse": true,
"collapsable": true,
"panels": [
{
"error": false,
"span": 12,
"editable": true,
"spyable": true,
"group": [
"default"
],
"type": "filtering"
}
]
},
{
"title": "Sales Over TIme and Facets",
"height": "350px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
{
"span": 10,
"editable": true,
"type": "histogram",
"loadingEditor": false,
"mode": "values",
"queries": {
"mode": "all",
"ids": [
0
],
"query": "q=*&wt=json&rows=100000&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&fl=ORDERDATE_dt SALES_f&group=true&group.field=DEALSIZE_s&group.limit=100000\n",
"custom": ""
},
"max_rows": 100000,
"value_field": "SALES_f",
"group_field": "DEALSIZE_s",
"auto_int": true,
"resolution": 100,
"interval": "7d",
"intervals": [
"auto",
"1s",
"1m",
"5m",
"10m",
"30m",
"1h",
"3h",
"12h",
"1d",
"1w",
"1M",
"1y"
],
"fill": 0,
"linewidth": 3,
"timezone": "browser",
"spyable": true,
"zoomlinks": true,
"bars": true,
"stack": true,
"points": false,
"lines": false,
"legend": true,
"x-axis": true,
"y-axis": true,
"percentage": false,
"interactive": true,
"options": true,
"tooltip": {
"value_type": "cumulative",
"query_as_alias": false
},
"title": "Sales Per Deal Size",
"sum_value": true,
"lines_smooth": false,
"show_queries": true,
"refresh": {
"enable": false,
"interval": 2
}
},
{
"span": 2,
"editable": true,
"type": "facet",
"loadingEditor": false,
"status": "Stable",
"queries": {
"mode": "all",
"ids": [
0
],
"query": "q=*&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&facet=true&facet.field=STATUS_s&facet.field=DEALSIZE_s&wt=json",
"basic_query": "q=*&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&facet=true&facet.field=STATUS_s&facet.field=DEALSIZE_s",
"custom": ""
},
"group": "default",
"style": {
"font-size": "9pt"
},
"overflow": "min-height",
"fields": [
"STATUS_s",
"DEALSIZE_s"
],
"spyable": true,
"facet_limit": 10,
"maxnum_facets": 5,
"foundResults": true,
"header_title": "Facet Fields",
"toggle_element": "DEALSIZE_s",
"show_queries": true,
"title": "Order Status And Deal Size",
"exportSize": null,
"offset": 0
}
]
},
{
"title": "Overview",
"height": "350px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
{
"span": 6,
"editable": true,
"type": "map",
"loadingEditor": false,
"queries": {
"mode": "all",
"ids": [
0
],
"query": "q=*&wt=json&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&rows=0&stats=true&stats.facet=COUNTRY_CODE_s&stats.field=SALES_f",
"custom": ""
},
"mode": "sum",
"field": "COUNTRY_CODE_s",
"stats_field": "SALES_f",
"decimal_points": 0,
"map": "world",
"useNames": false,
"colors": [
"#A0E2E2",
"#265656"
],
"size": 3000,
"exclude": [],
"spyable": true,
"index_limit": 0,
"show_queries": true,
"title": "World Sales Map"
},
{
"span": 6,
"editable": true,
"type": "heatmap",
"loadingEditor": false,
"queries": {
"mode": "all",
"ids": [
0
],
"query": "q=*&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&wt=json&rows=0&facet=true&facet.pivot=PRODUCTCODE_s,COUNTRY_s&facet.limit=10&facet.pivot.mincount=0",
"custom": ""
},
"size": 0,
"row_field": "PRODUCTCODE_s",
"col_field": "COUNTRY_s",
"row_size": 10,
"color": "blue",
"spyable": true,
"transpose_show": true,
"transposed": false,
"show_queries": true,
"title": "Product Lines Per Country"
}
]
},
{
"title": "Top Customers and Average Order Total Per Territory",
"height": "250px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
{
"span": 4,
"editable": true,
"group": [
"default"
],
"type": "terms",
"queries": {
"mode": "all",
"ids": [
0
],
"query": "q=*&wt=json&rows=0&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&stats=true&stats.field={!tag=piv1}SALES_f&facet=true&facet.pivot={!stats=piv1}TERRITORY_s&facet.limit=5&facet.missing=true&f.TERRITORY_s.facet.sort=count"
},
"field": "TERRITORY_s",
"exclude": [],
"missing": false,
"other": false,
"size": 5,
"order": "count",
"style": {
"font-size": "10pt"
},
"donut": false,
"tilt": false,
"labels": true,
"arrangement": "horizontal",
"chart": "bar",
"counter_pos": "above",
"title": "Average Order Total By Territory",
"spyable": true,
"time_field": "event_timestamp",
"mode": "mean",
"stats_field": "SALES_f",
"decimal_points": 0,
"pages": 10,
"sortBy": "count",
"logAxis": false,
"exportSize": 100,
"lastColor": "",
"show_queries": true,
"bar_chart_arrangement": "vertical",
"chartColors": [
"#EAB839"
],
"refresh": {
"enable": false,
"interval": 2
}
},
{
"span": 8,
"editable": true,
"type": "terms",
"loadingEditor": false,
"queries": {
"mode": "all",
"ids": [
0
],
"query": "q=*&wt=json&rows=0&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&stats=true&stats.field={!tag=piv1}SALES_f&facet=true&facet.pivot={!stats=piv1}CUSTOMERNAME_s&facet.limit=10&facet.missing=true&f.CUSTOMERNAME_s.facet.sort=count",
"custom": ""
},
"mode": "sum",
"field": "CUSTOMERNAME_s",
"stats_field": "SALES_f",
"decimal_points": 0,
"exclude": [],
"missing": false,
"other": false,
"size": 10,
"pages": 10,
"sortBy": "count",
"order": "descending",
"style": {
"font-size": "10pt"
},
"donut": false,
"tilt": false,
"labels": true,
"logAxis": false,
"arrangement": "vertical",
"chart": "bar",
"counter_pos": "left",
"exportSize": 100,
"lastColor": "",
"spyable": true,
"show_queries": true,
"bar_chart_arrangement": "vertical",
"chartColors": [
"#F9BA8F"
],
"refresh": {
"enable": false,
"interval": 2
},
"title": "Top 10 Customers Sales"
}
]
},
{
"title": "By Deal Size",
"height": "250px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
{
"span": 4,
"editable": true,
"type": "terms",
"loadingEditor": false,
"queries": {
"mode": "all",
"ids": [
0
],
"query": "q=*&wt=json&rows=0&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&stats=true&stats.field={!tag=piv1}SALES_f&facet=true&facet.pivot={!stats=piv1}DEALSIZE_s&facet.limit=10&facet.missing=true&f.DEALSIZE_s.facet.sort=count",
"custom": ""
},
"mode": "sum",
"field": "DEALSIZE_s",
"stats_field": "SALES_f",
"decimal_points": 0,
"exclude": [],
"missing": false,
"other": false,
"size": 10,
"pages": 10,
"sortBy": "count",
"order": "descending",
"style": {
"font-size": "10pt"
},
"donut": false,
"tilt": false,
"labels": true,
"logAxis": false,
"arrangement": "horizontal",
"chart": "pie",
"counter_pos": "none",
"exportSize": 100,
"lastColor": "",
"spyable": true,
"show_queries": true,
"bar_chart_arrangement": "vertical",
"chartColors": [
"#E24D42",
"#1F78C1",
"#BA43A9",
"#705DA0",
"#508642",
"#CCA300",
"#447EBC",
"#C15C17",
"#890F02",
"#0A437C",
"#6D1F62",
"#584477",
"#B7DBAB",
"#F4D598",
"#70DBED",
"#F9BA8F",
"#F29191",
"#82B5D8",
"#E5A8E2",
"#AEA2E0",
"#629E51",
"#E5AC0E",
"#64B0C8",
"#E0752D",
"#BF1B00",
"#0A50A1",
"#962D82",
"#614D93",
"#9AC48A",
"#F2C96D",
"#65C5DB",
"#F9934E",
"#EA6460",
"#5195CE",
"#D683CE",
"#806EB7",
"#3F6833",
"#967302",
"#2F575E",
"#99440A",
"#58140C",
"#052B51",
"#511749",
"#3F2B5B",
"#E0F9D7",
"#FCEACA",
"#CFFAFF",
"#F9E2D2",
"#FCE2DE",
"#BADFF4",
"#F9D9F9",
"#DEDAF7"
],
"refresh": {
"enable": false,
"interval": 2
},
"title": "Sales By Deal Size"
},
{
"span": 4,
"editable": true,
"type": "rangeFacet",
"loadingEditor": false,
"mode": "count",
"time_field": "timestamp",
"queries": {
"mode": "all",
"ids": [
0
],
"query": "q=*&wt=json&rows=0&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&facet=true&facet.range=QUANTITYORDERED_i&facet.range.start=-1&facet.range.end=101&facet.range.gap=2\n",
"custom": ""
},
"max_rows": 100000,
"value_field": null,
"fill": 0,
"linewidth": 3,
"auto_int": true,
"resolution": 100,
"interval": 2,
"interval_decimal": 0,
"resolutions": [
5,
10,
25,
50,
75,
100
],
"spyable": true,
"zoomlinks": true,
"bars": true,
"stack": true,
"points": false,
"lines": false,
"lines_smooth": false,
"legend": true,
"x-axis": true,
"y-axis": true,
"percentage": false,
"interactive": true,
"options": true,
"minimum": 0,
"maximum": 100,
"chart_minimum": "0",
"chart_maximum": "100",
"tooltip": {
"value_type": "cumulative",
"query_as_alias": false
},
"showChart": true,
"show_queries": true,
"refresh": {
"enable": false,
"interval": 2
},
"title": "Quantity Distribution",
"range_field": "QUANTITYORDERED_i",
"unit": "Unit"
},
{
"span": 4,
"editable": true,
"type": "terms",
"loadingEditor": false,
"queries": {
"mode": "all",
"ids": [
0
],
"query": "q=*&wt=json&rows=0&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&stats=true&stats.field={!tag=piv1}SALES_f&facet=true&facet.pivot={!stats=piv1}QTR_ID_i&facet.limit=10&facet.missing=true&f.QTR_ID_i.facet.sort=count",
"custom": ""
},
"mode": "sum",
"field": "QTR_ID_i",
"stats_field": "SALES_f",
"decimal_points": 0,
"exclude": [],
"missing": false,
"other": false,
"size": 10,
"pages": 10,
"sortBy": "count",
"order": "descending",
"style": {
"font-size": "10pt"
},
"donut": false,
"tilt": false,
"labels": true,
"logAxis": false,
"arrangement": "horizontal",
"chart": "bar",
"counter_pos": "above",
"exportSize": 100,
"lastColor": "",
"spyable": true,
"show_queries": true,
"bar_chart_arrangement": "vertical",
"chartColors": [
"#6ED0E0"
],
"refresh": {
"enable": false,
"interval": 2
},
"title": "Sales By Quarter"
}
]
},
{
"title": "Table",
"height": "350px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
{
"span": 12,
"editable": true,
"group": [
"default"
],
"type": "table",
"size": 10,
"pages": 5,
"offset": 0,
"sort": [
"id",
"desc"
],
"style": {
"font-size": "9pt"
},
"overflow": "min-height",
"fields": [
"COUNTRY_s",
"CUSTOMERNAME_s",
"DEALSIZE_s",
"ORDERDATE_dt",
"PRICEEACH_f",
"PRODUCTLINE_s",
"QUANTITYORDERED_i",
"SALES_f"
],
"highlight": [],
"sortable": true,
"header": true,
"paging": true,
"spyable": true,
"queries": {
"mode": "all",
"ids": [
0
],
"query": "q=*&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&sort=id desc&wt=json&rows=50",
"basic_query": "q=*&fq=ORDERDATE_dt:[2017-03-22T22:00:00.000Z%20TO%202019-09-08T22:00:00.000Z]&fq=QUANTITYORDERED_i:[-1 TO 100]&sort=id desc"
},
"field_list": true,
"status": "Stable",
"trimFactor": 300,
"normTimes": true,
"title": "Orders",
"time_field": "event_timestamp",
"important_fields": [
"CUSTOMERNAME_s",
"ORDERDATE_dt",
"COUNTRY_s",
"DEALSIZE_s",
"PRICEEACH_f"
],
"saveOption": "json",
"exportSize": 50,
"exportAll": true,
"displayLinkIcon": true,
"imageFields": [],
"imgFieldWidth": "auto",
"imgFieldHeight": "85px",
"show_queries": true,
"maxNumCalcTopFields": 20,
"calcTopFieldValuesFromAllData": false,
"subrowMaxChar": 300,
"subrowOffset": 0,
"refresh": {
"enable": false,
"interval": 2
}
}
]
}
],
"editable": true,
"index": {
"interval": "none",
"pattern": "[logstash-]YYYY.MM.DD",
"default": "_all"
},
"style": "light",
"failover": false,
"panel_hints": true,
"loader": {
"save_gist": true,
"save_elasticsearch": true,
"save_local": true,
"save_default": true,
"save_temp": true,
"save_temp_ttl_enable": true,
"save_temp_ttl": "30d",
"load_gist": true,
"load_elasticsearch": true,
"load_elasticsearch_size": 20,
"load_local": true,
"hide": false,
"dropdown_collections": false,
"save_as_public": false
},
"solr": {
"server": "/solr/",
"core_name": "sales_shard1_replica_n1",
"core_list": [
"sales_shard1_replica_n1"
],
"global_params": ""
},
"username": "guest",
"home": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.