test_1
nanannanannaa
{
  "__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"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "mysql",
        "uid": "${DS_MYSQL}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "SUM(gmv)"
            },
            "properties": [
              {
                "id": "unit",
                "value": "locale"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 27,
        "w": 10,
        "x": 0,
        "y": 0
      },
      "id": 1,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true
      },
      "pluginVersion": "9.5.2",
      "targets": [
        {
          "dataset": "fcom_reporting",
          "datasource": {
            "type": "mysql",
            "uid": "${DS_MYSQL}"
          },
          "editorMode": "code",
          "format": "table",
          "key": "Q-218e5c55-69d2-4a98-8c6d-2ad125e3b941-0",
          "rawQuery": true,
          "rawSql": "SELECT label, SUM(gmv) FROM fcom_reporting.daily_gmv_final WHERE substr(dt,1,10) = '2023-05-16' GROUP BY label order by gmv desc",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [
                  {
                    "name": "label",
                    "type": "functionParameter"
                  }
                ],
                "type": "function"
              },
              {
                "name": "SUM",
                "parameters": [
                  {
                    "name": "gmv",
                    "type": "functionParameter"
                  }
                ],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "name": "label",
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50,
            "whereJsonTree": {
              "children1": [
                {
                  "id": "ba99ab9a-89ab-4cde-b012-318828024f16",
                  "properties": {
                    "field": "dt",
                    "operator": "equal",
                    "value": [
                      "2023-05-16 11:40:26"
                    ],
                    "valueSrc": [
                      "value"
                    ],
                    "valueType": [
                      "datetime"
                    ]
                  },
                  "type": "rule"
                }
              ],
              "id": "89baab9b-89ab-4cde-b012-318827fc11c3",
              "type": "group"
            },
            "whereString": "dt = '2023-05-16 11:40:26.000'"
          },
          "table": "daily_gmv_final"
        }
      ],
      "title": "detail",
      "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": 27,
        "w": 12,
        "x": 10,
        "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) = '2023-05-16'\r\nand label <> 'Count all bound accounts'\r\norder by gmv desc",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        }
      ],
      "title": "graph",
      "type": "barchart"
    },
    {
      "datasource": {
        "type": "mysql",
        "uid": "${DS_MYSQL}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "continuous-GrYlRd"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false,
            "minWidth": 50,
            "width": 187
          },
          "mappings": [],
          "thresholds": {
            "mode": "percentage",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "#EAB839",
                "value": 0
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "order_yesterday"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 133
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "P2D"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 88
              },
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "color",
                "value": {
                  "mode": "thresholds"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "P7D"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 92
              },
              {
                "id": "unit",
                "value": "percentunit"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "P1M"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 73
              },
              {
                "id": "unit",
                "value": "percentunit"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 41,
        "w": 11,
        "x": 0,
        "y": 27
      },
      "id": 3,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": [
            "P2D",
            "P7D",
            "order_yesterday"
          ],
          "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\r\n, order_yesterday\r\n, (order_yesterday - order_p2d)/order_p2d P2D\r\n, (order_yesterday - order_p1w)/order_p1w P7D\r\n, (order_yesterday - order_p1m)/order_p1m P1M\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 dt = 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 dt = 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 dt = 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 dt = 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 dt = 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 dt = date_sub(curdate(), interval 2 day) then number_of_orders end\r\n\t) order_p2d\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen dt = 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 dt = 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 dt = 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 dt = 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 dt = 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 dt = 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 dt = 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 dt = date_sub(curdate(), interval 2 day) then number_of_orders end\r\n\t) order_p2d\r\n\t, sum(\r\n\t\tcase \r\n\t\t\twhen dt = 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 dt = 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 , order_yesterday desc\r\n) ord\r\nwhere flag_act_exp = 'ACTIVE'\r\n",
          "refId": "A",
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          }
        }
      ],
      "title": "Order Growth",
      "type": "table"
    }
  ],
  "refresh": "",
  "schemaVersion": 38,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "test_1",
  "uid": "b19bdd91-3417-4c05-a2a4-58642b082139",
  "version": 6,
  "weekStart": "",
  "gnetId": 18780,
  "description": "nanannanannaa"
}