Comments (3)
Hi @podshumok
Sorry for late response. I have just tried to use some func in unescape
macros and it works well:
SELECT
$unescape(intDiv($col, $col2)) d,
count()
FROM $table
WHERE $timeFilter and $unescape($col) = 1
GROUP BY d
Converted to:
SELECT intDiv(Aid, Ms) d, count()
FROM default.events
WHERE EventDate BETWEEN toDate(1519404902)
AND toDate(1519405682)
AND EventTime BETWEEN toDateTime(1519404902)
AND toDateTime(1519405682)
AND Aid = 1
GROUP BY d
Can u provide me with full example of query?
from clickhouse-grafana.
Closed due to inactivity
from clickhouse-grafana.
Hello!
So I finally figured out an example that is simple enough to demonstrate
Here is a minimal dashboard with problem I am dealing with:
{
"panels": [
{
"datasource": "clickhouse",
"id": 2,
"targets": [
{
"format": "table",
"query": "SELECT\n $unescape($f) AS b\nFROM (\n SELECT * FROM system.numbers LIMIT 1\n)"
}
],
"type": "singlestat"
}
],
"templating": {
"list": [
{
"current": {
"text": "count",
"value": "count()"
},
"multi": true,
"name": "f",
"options": [
{
"selected": true,
"text": "count",
"value": "count()"
},
{
"selected": false,
"text": "sum",
"value": "sum(number)"
},
{
"selected": false,
"text": "other",
"value": "concat('a', toString(number))"
}
],
"type": "custom"
}
]
},
"title": "New dashboard"
}
Looks like a problem
In this case macros will add additional )
after function call and it also will replace ''
symbols in the variable (see other
option)
from clickhouse-grafana.
Related Issues (20)
- Support for multiple grouping columns for calculations like increaseColumns HOT 1
- Unexpected error when using $conditionalTest macro HOT 11
- The 'Format As' feature is not working. HOT 1
- No longer possible to specify custom timestamp column value in 3.0.0 HOT 1
- golang part of plugin ignore tlsSkipVerify oprtion from datasource settings
- Broken table with specific query in 3.0.0 HOT 6
- databend datase return 400 error code which not correctly handled on plugin side HOT 12
- Show Generated SQL - wrong formatting and lost query state HOT 2
- `step` field in query editor doesn't work
- state doens't pass to query execution HOT 2
- autocomplete duplicate the same names
- Drop down select how to clear value?
- `isClearable` doesn't work for Timestamp Column, and this is weird
- Annotations doesn't work
- Problems with Cloudflare analytics engine Clickhouse after upgrading to 3.0.0 HOT 3
- Syntax highlight stop works when auto-complete query failed HOT 1
- Adding new alerts doesn't work
- selected values in drop-down select in QueryBuilder doesn't clear when we change datasource
- $columns + subquery stop works after 3.1.1 HOT 2
- Explore query mode keeps resetting to Time Series when editing query
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clickhouse-grafana.