Skip to content

Business intelligence made simple

Added section on variables

Andrewb61c4f63091d
diff --git a/README.md b/README.md
index f74f0b41..23f0876d 100644
--- a/README.md
+++ b/README.md
@@ -162,6 +162,31 @@ Customize user name
Blazer.user_name = :first_name
```
+## Variables
+
+Create queries with variables
+
+```sql
+SELECT COUNT(*) FROM users WHERE gender = {gender}
+```
+
+### Smart Variables
+
+Supposed you have this query
+
+```sql
+SELECT COUNT(*) FROM users WHERE city_id = {city_id}
+```
+
+Instead of remembering each city’s id, users can select cities by name.
+
+Add a smart variable with:
+
+```yml
+smart_variables:
+ city_id: "SELECT id, name FROM cities ORDER BY name ASC"
+```
+
## Charts
Blazer will automatically generate charts based on the types of the columns returned in your query.