Teneo Developers
Table of Contents
Was this page helpful?

Share to

Command

When using TQL, we are always telling it to do something for us: show us a list of user inputs, count the number of times the Safetynet occurred, compute the number of sessions per day, etc. The action we tell TQL to take is what we call the command. The command is the most crucial part of a TQL query, as it tells TQL how to process and present the information that the query extracts from the session logs.

This query starts with a command: la, which is shorthand for listAll: TQL - Command Annot

tql

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

These are the five commands that form the basis of TQL:

CommandAbbreviated FormReturn Value
listAlllalist
listUniquelulist
countAllcainteger
countUniquecuinteger
distributedtable

The command is an essential part of every TQL query. Without it, you will receive a Query Failed message.

List all

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

ExampleDescription
la t.e.userInputLists all user inputs, including duplicates

List unique

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

ExampleDescription
lu s.idLists all unique session ids
lu t.e.userInputLists all user inputs, excluding duplicates

Count all

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

ExampleDescription
ca t.e.userInputCounts all user inputs

Count unique

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

ExampleDescription
cu t.e.userInputCounts all unique user inputs, excluding duplicates
cu s.idCounts the number of dialogues / the number of unique sessions

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 unordered counts.

ExampleDescription
d t.e.userInputShows a distribution of occurrences of each unique user input (including empty values)