1. A query generation system, the system comprising: a computer processor; and a memory device in communication with the computer processor having sets of instructions stored thereon which, when executed by the computer processor, cause the computer processor to: generate a query for at least one of retrieving data that satisfies a conditional expression from a database; perform an arbitrary calculation on at least part of the retrieved data; receive an input query; analyze the input query to ascertain whether the input query contains a replaceable token; and if the input query contains a replaceable token, replace the replaceable token with at least one of user input specifying a parameter of the conditional expression and the arbitrary calculation; and perform at least one of: generating an output query for retrieving the data that satisfy the conditional expression and performing the arbitrary calculation on the retrieved data.