Command

The point of TQL is to tell it to do something for us: show us a list of user inputs, count the number times the safetynet occurred, compute the number of session per day, etc. This something we tell TQL to do, to list, to count, etc. is the command. Without a command you don't have a query. In fact, the most essential and indespensible part of a TQL query is the command. It tells TQL how to process and present the information the query extracts from the session logs.

In this query the command is seen at the beginning of the query: la which is shorthand for listAll:

la s.id, t.e.userInput, t.e2.answerText:  t.e.userInput != "" limit 30 

These are the five mmands that form the basis of TQL

Command Abbreviated Form Return Value
listAll la list
listUnique lu list
countAll ca integer
countUnique cu integer
distribute d table

The command is an essential part of every TQL query. Without it TQL doesn't know what to do. If you try a query without the command you will receive a Query Failed message.

List all

The listAll function retrieves all values matching the query and returns a list.

Example Description
la t.e.userInput Lists all user inputs, including duplicates

List unique

The listUnique function retrieves all unique values matching the query and returns a list.

Example Description
lu s.id List all unique session ids
lu t.e.userInput List all user inputs, excluding duplicates

Count all

The countAll function counts all values matching the query and returns an integer.

Example Description
ca t.e.userInput Count all user inputs

Count unique

The countUnique function counts all unique values matching the query and returns an integer.

Example Description
cu t.e.userInput Count all unique user inputs, excluding duplicates
cu s.id Count the number of dialogs / the number of unique sessions.

Note: Uniqueness is determined by string comparison and is case sensitive.

Distribute

The distribute function counts the number of occurrences for all unique values matching the query and returns a 2-column table of un-ordered counts.

Example Description
d t.e.userInput Show a distribution of occurrences of each unique user input (including empty values)

Was this page helpful?