You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-4Lines changed: 31 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,12 +104,39 @@ For Time series query:
104
104
105
105
##### Query Variables
106
106
107
-
You can use query variable in your query.<br/>
108
-
Query variables are used to filter the data displayed in the dashboard.
107
+
You can use query variable in your Snowflake queries by using [variable syntax](https://grafana.com/docs/grafana/latest/dashboards/variables/variable-syntax/).<br/>
108
+
You can also set the [interpolation format](https://grafana.com/docs/grafana/latest/dashboards/variables/variable-syntax/#general-syntax) in the variable.<br/>
109
109
110
-
Sample query variable usage:
110
+
Single-value variables usage:
111
111
```sql
112
-
SELECT column FROM table WHERE column in ($variable)
112
+
-- $variable = 'xxxxxxx'
113
+
SELECT column FROM table WHERE column = ${variable:sqlstring}
114
+
-- Interpolation result
115
+
SELECT column FROM table WHERE column ='xxxxxxx'
116
+
```
117
+
118
+
Single-value variables with format usage:
119
+
```sql
120
+
-- $variable = 'xxxxxxx'
121
+
SELECT column FROM table WHERE column = ${variable:raw}
122
+
-- nterpolation result
123
+
SELECT column FROM table WHERE column = xxxxxxx
124
+
```
125
+
126
+
Multiple-value variables usage:
127
+
```sql
128
+
-- $variable = ['xxxxxxx','yyyyyy']
129
+
SELECT column FROM table WHERE column in (${variable:sqlstring})
130
+
-- Interpolation result
131
+
SELECT column FROM table WHERE column in ('xxxxxxx','yyyyyy')
132
+
```
133
+
134
+
Multiple-value variables with format usage:
135
+
```sql
136
+
-- $variable = ['xxxxxxx','yyyyyy']
137
+
SELECT column FROM table WHERE column in ${variable:regex}
138
+
-- Interpolation result
139
+
SELECT column FROM table WHERE column in (test1|test2)
0 commit comments