test1
test1
test1
{
  "__inputs": [
    {
      "name": "DS_MYSQL",
      "label": "MySQL",
      "description": "",
      "type": "datasource",
      "pluginId": "mysql",
      "pluginName": "MySQL"
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "panel",
      "id": "barchart",
      "name": "Bar chart",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "9.5.2"
    },
    {
      "type": "datasource",
      "id": "mysql",
      "name": "MySQL",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "test1",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "mysql",
        "uid": "${DS_MYSQL}"
      },
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false,
            "width": 172
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "label"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 245
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "gmv"
            },
            "properties": [
              {
                "id": "unit",
                "value": "locale"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "pct"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "custom.width",
                "value": 96
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 23,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "id": 1,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "9.5.2",
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "${DS_MYSQL}"
          },
          "editorMode": "code",
          "format": "table",
          "rawQuery": true,
          "rawSql": "select label, gmv, pct\r\nfrom fcom_reporting.daily_gmv_final\r\nwhere substr(dt,1,10) = substr(date_sub(curdate(), interval 1 day),1,10)\r\nand label != 'Count all bound accounts'",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        }
      ],
      "title": "Panel Title",
      "type": "table"
    },
    {
      "datasource": {
        "type": "mysql",
        "uid": "${DS_MYSQL}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "fillOpacity": 80,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineWidth": 1,
            "scaleDistribution": {
              "type": "linear"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 23,
        "w": 11,
        "x": 12,
        "y": 0
      },
      "id": 2,
      "options": {
        "barRadius": 0,
        "barWidth": 0.97,
        "fullHighlight": false,
        "groupWidth": 0.7,
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "right",
          "showLegend": true
        },
        "orientation": "horizontal",
        "showValue": "never",
        "stacking": "none",
        "tooltip": {
          "mode": "single",
          "sort": "none"
        },
        "xTickLabelRotation": 0,
        "xTickLabelSpacing": 0
      },
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "${DS_MYSQL}"
          },
          "editorMode": "code",
          "format": "table",
          "rawQuery": true,
          "rawSql": "select label, gmv\r\nfrom fcom_reporting.daily_gmv_final\r\nwhere substr(dt,1,10) = substr(date_sub(curdate(), interval 1 day),1,10)\r\nand label <> 'Count all bound accounts'",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        }
      ],
      "title": "Panel Title",
      "type": "barchart"
    },
    {
      "datasource": {
        "type": "mysql",
        "uid": "${DS_MYSQL}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false,
            "width": 20
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-red",
                "value": null
              },
              {
                "color": "dark-green",
                "value": 0
              }
            ]
          },
          "unit": "locale"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "vs_last_2_day"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "type": "color-background"
                }
              },
              {
                "id": "custom.width",
                "value": 164
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "compared_to_last_week"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "type": "color-background"
                }
              },
              {
                "id": "custom.width",
                "value": 148
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "vs_last_week"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "type": "color-background"
                }
              },
              {
                "id": "custom.width",
                "value": 108
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "vs_last_month"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 113
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "type": "color-background"
                }
              },
              {
                "id": "unit",
                "value": "percentunit"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "vs_last_week"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 100
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "vs_last_2_day"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 113
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "gmv_yesterday"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 119
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "label"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 240
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 35,
        "w": 12,
        "x": 0,
        "y": 23
      },
      "id": 3,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "gmv_yesterday"
          }
        ]
      },
      "pluginVersion": "9.5.2",
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "${DS_MYSQL}"
          },
          "editorMode": "code",
          "format": "table",
          "rawQuery": true,
          "rawSql": "select label\r\n, gmv_yesterday\r\n, (gmv_yesterday - gmv_p2d)/gmv_p2d vs_last_2_day\r\n, (gmv_yesterday - gmv_p1w)/gmv_p1w vs_last_week\r\n, (gmv_yesterday - gmv_p1m)/gmv_p1m vs_last_month\r\nfrom \r\n(\r\n\tselect \r\n\tflag_act_exp \r\n\t, case \r\n\t\t\twhen flag_act_exp = 'ACTIVE' then  'only real agent operation account'\r\n\t\t\telse 'EXPIRED'\r\n\tend label\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 1 day) then gmv end\r\n\t) gmv_yesterday\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 2 day) then gmv end\r\n\t) gmv_p2d\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 7 day) then gmv end\r\n\t) gmv_p1w\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 1 month) then gmv end\r\n\t) gmv_p1m\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 1 day) then number_of_orders  end\r\n\t) order_yesterday\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 7 day) then number_of_orders end\r\n\t) order_p1w\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 1 month) then number_of_orders end\r\n\t) order_p1m\r\n\tfrom daily_gmv dg \r\n\tgroup by flag_act_exp \r\n\t, case \r\n\t\t\twhen flag_act_exp = 'ACTIVE' then  'only real agent operation account'\r\n\t\t\telse 'EXPIRED'\r\n\tend \r\n\tunion all\r\n\tselect flag_act_exp\r\n\t, account label\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 1 day) then gmv end\r\n\t) gmv_yesterday\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 2 day) then gmv end\r\n\t) gmv_p2d\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 7 day) then gmv end\r\n\t) gmv_p1w\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 1 month) then gmv end\r\n\t) gmv_p1m\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 1 day) then number_of_orders  end\r\n\t) order_yesterday\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 7 day) then number_of_orders end\r\n\t) order_p1w\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen substr(dt,1,10) = date_sub(curdate(), interval 1 month) then number_of_orders end\r\n\t) order_p1m\r\n\tfrom daily_gmv dg \r\n\tgroup by flag_act_exp \r\n\t, account \r\n\torder by flag_act_exp , gmv_yesterday desc\r\n) gmv\r\nwhere flag_act_exp = 'ACTIVE'\r\n",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        }
      ],
      "title": "Panel Title",
      "type": "table"
    }
  ],
  "refresh": "",
  "schemaVersion": 38,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "1d"
    ]
  },
  "timezone": "",
  "title": "test1",
  "uid": "e5114524-afd1-4e03-9040-285562fa2506",
  "version": 11,
  "weekStart": "",
  "gnetId": 18816
}