Beyond the Basics
You’ve mastered the basicfield = "value" structure of UQL. Now it’s time to unlock its true power: the ability to ask deep, relational questions that span across your entire business data model.
This guide covers advanced patterns that will allow you to perform sophisticated data analysis, focusing on cross-object queries, built-in functions, and historical queries.
The Core of Advanced UQL: Cross-Object Queries
This is the most powerful feature of UQL. When you have anObject Picker field or a Parent-Child relationship, UQL allows you to “walk” across that relationship using dot notation to query fields on the referenced 🧊 Object.
The ‘Dot Notation’ Syntax
The syntax is simple and intuitive:referencing_field_key.field_on_referenced_object
- Simple Example: Find all 
Projectsfor enterprise clients.- Your 
🧊 ProjectObject Type has anObject Pickerfield with the keyclient. - UQL Query: 
client.tier = "Enterprise" - Explanation: 
clientis the field on the🧊 Project, andtieris a field on the referenced🧊 ClientObject. 
 - Your 
 - Multi-Level Example: Find all 
Taskswhere the parentProject’sClientis based in “New York”.- UQL Query: 
parent.client.city = "New York" - Explanation: You can chain together multiple references to traverse complex relationships in your data model (
Task→Project→Client). 
 - UQL Query: 
 
parent.client.city query, with arrows pointing from each part of the query to the corresponding field in the diagram.]
Using Functions in UQL
UQL includes built-in functions to handle dynamic values and more complex logic.| Function | Description | Example | 
|---|---|---|
currentUser() | A dynamic value representing the user currently running the query. | assignee = "currentUser()" | 
now() | The current date and time. | start_date > "now()" | 
today() | The current date (without time). | due_date = "today()" | 
count(field_key) | Counts the number of items in a multi-value field (e.g., a Multiple Objects Picker). | count(sub_tasks) > 10 | 
Querying History
As covered in our guide to Leveraging Workflow Data, you can use special operators to query the history of an🧊 Object’s status changes. This is a powerful feature for process analysis.
- Example: 
status changed from "IN_REVIEW" to "APPROVED" - Use Case: This is essential for building 
Dashboardsthat measure process efficiency orSaved Filtersthat find🧊 Objectsthat have ever passed through a critical review stage. 
Putting It All Together: A Complex Example
By combining these advanced techniques, you can answer very specific business questions.- 
Business Question: “Find all 
IN_PROGRESSTasksassigned to me, which belong to aProjectfor an ‘Enterprise’ tierClient, and where thatProjecthas more than 5 stakeholders.” - 
UQL Query:
 
What’s Next?
Congratulations! You have now completed the deep dive into all of the Core LEGO Pieces of the Luklak platform, from theUniversal Object to the UQL engine that queries them.
You have the full architectural knowledge. It’s time to put it all together and build your first complete solution.