Hi @mattabrams
Thank you for answering.
I want column names to be just simple as influxdb’s field name like “pnlPcnt” not "pnlPcnt {_start=“2021-8…}”.
I attached my json model below.
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 9,
"iteration": 1629786772415,
"links": [],
"panels": [
{
"datasource": "InfluxDB Cloud",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 22,
"w": 9,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "table",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"query": "from(bucket: \"path-trading\")\r\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"path-info\")\r\n |> filter(fn: (r) => r[\"_field\"] == \"pnlPcnt\")\r\n |> filter(fn: (r) => r[\"category\"] == \"${OrderSizeCategory}\") \r\n |> filter(fn: (r) => r[\"exchange\"] == \"${ExchangeCategory}\") \r\n |> sort(columns:[\"StrategyName\"])\r\n |> aggregateWindow(every: 5s, fn: last, createEmpty: false)\r\n |> yield(name: \"last\")\r\n ",
"refId": "A"
}
],
"title": "Path Arb",
"transformations": [],
"type": "timeseries"
},
{
"datasource": "InfluxDB Cloud",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"displayMode": "auto"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 22,
"w": 15,
"x": 9,
"y": 0
},
"id": 4,
"options": {
"showHeader": true,
"sortBy": []
},
"pluginVersion": "8.0.3",
"targets": [
{
"query": "from(bucket: \"path-trading\")\r\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"path-info\")\r\n |> filter(fn: (r) => r[\"_field\"] == \"pnlPcnt\" or r[\"_field\"] == \"path1\" or r[\"_field\"] == \"path2\"or r[\"_field\"] == \"feeForward\" or r[\"_field\"] == \"feeBackward\" or r[\"_field\"] == \"oldestTimestamp\" )\r\n |> filter(fn: (r) => r[\"category\"] == \"${OrderSizeCategory}\") \r\n |> filter(fn: (r) => r[\"strategyName\"] == \"${StrategyName}\") \r\n |> sort(columns:[\"_field\"], desc: true)\r\n |> pivot(\r\n rowKey:[\"_time\" ],\r\n columnKey: [\"_field\"],\r\n valueColumn: \"_value\"\r\n ) \r\n |> sort(columns:[\"_time\"], desc: true)",
"refId": "A"
}
],
"title": "Pnl Table",
"transformations": [],
"type": "table"
}
],
"refresh": "",
"schemaVersion": 30,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {
"selected": false,
"text": [
"Big"
],
"value": [
"Big"
]
},
"description": "Order Size Category",
"error": null,
"hide": 0,
"includeAll": false,
"label": "OrderSizeCategory",
"multi": true,
"name": "OrderSizeCategory",
"options": [
{
"selected": true,
"text": "Big",
"value": "Big"
},
{
"selected": false,
"text": "Small",
"value": "Small"
}
],
"query": "Big,Small",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
},
{
"allValue": null,
"current": {
"selected": false,
"text": "Global",
"value": "Global"
},
"description": "ExchangeCategory",
"error": null,
"hide": 0,
"includeAll": false,
"label": "ExchangeCategory",
"multi": false,
"name": "ExchangeCategory",
"options": [
{
"selected": true,
"text": "Global",
"value": "Global"
},
{
"selected": false,
"text": "Simple",
"value": "Simple"
}
],
"query": "Global,Simple",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
},
{
"allValue": null,
"current": {
"selected": false,
"text": "Global-XXX-YYY",
"value": "Global-XXX-YYY"
},
"datasource": "InfluxDB Cloud",
"definition": "import \"influxdata/influxdb/v1\"\r\nv1.tagValues(\r\n bucket: v.bucket,\r\n tag: \"strategyName\",\r\n predicate: (r) => true,\r\n start: -1d\r\n)",
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "StrategyName",
"options": [],
"query": "import \"influxdata/influxdb/v1\"\r\nv1.tagValues(\r\n bucket: v.bucket,\r\n tag: \"strategyName\",\r\n predicate: (r) => true,\r\n start: -1d\r\n)",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Path Arb",
"uid": "qRlBb_Z7z",
"version": 15
}