Teneo Query Language allows you to write custom queries and retrieve results which can be used to improve your solution. TQL queries run over session’s transactions events. For example, it could be used to identify all inputs from the end user which ended up in the safety net or investigate how often people visits a newly created flow which could be important to your business.
The TQL queries are written in the Query tab and executed using the run query button or the short-cut command ctrl-c. The main LDS window allows multiple tabs to be opened but be aware, studio does not cache these tabs. If you close your main LDS window without saving the queries, they will be lost. Shared queries can be found in the Shared Queries tab and your recent run queries can be found in the tab Recent Queries, both are located to the left in the main LDS window.
A TQL query consists of a command, one or more selection and optionally, a set of constraints and ordering.
In the image below the command would be d, distribute and the selection would be t.e.userInput and should be read as distribute the transaction events ‘userInput’. This query will return all the user inputs.
Constraints can be added to make the selection more strict. The annotated query below should be read as: Distribute the transaction events 'userInputs' where the transaction event 'userInput' is not empty and order the returned results from most to least.
Note that you can order a command and a selection, it does not require the constraint.
In the video below we will construct a query that will return the number of different coffees that has been purchased, and then order this list to see which coffee has been purchased the most.
Here is the query that was used in the video:
d t.e.fv:s:orderedCoffeeType : t.e.fv:s:orderedCoffeeType != "" order by count desc
Besides the cookbook, here are some pre-defined TQL queries which you can copy and add to your LDS.
|TQL - Query||Description|
||Sessions by Day|
||Transactions by Day|
||Flows Triggered by Day|
Was this page helpful?