Official Content

When adding query elements to a query definition, several options are available to  be assigned.

Arithmetic expressions

Any valid arithmetic expression such as:

# Formula Expression
CustomerAge + CustomerIdentifierId – 1245
InvoiceSubtotal * 2
# Conditional Expression
iif(CitizenStatus = 1, "Waiting", Iif(CitizenStatus = 2, "OK", Iif(CitizenStatus = 3, "Error", Iif(CitizenStatus = 4, "Pending", "Other"))))

arithmetic expression:
QueryObject_cond_arithmetic_expression

Aggregate expressions

Any valid aggregatte expression such as:

Sum(CustomerId + CustomerId)
Sum(InvoiceTaxes+InvoiceNonTaxes)
Sum(CustomerId) + Sum(CustomerId)
Sum(InvoiceTotal)/Count(InvoiceId)

QueryObject_aggregation_expression
by:
QueryObject_by

defined by:
QueryObject_defined_by

weighted by:
QueryObject_weighted_by

Filtering expressions

A valid filtering expression:

Sum(InvoiceTotal) where Year(InvoiceDate) = 2008
Sum(InvoiceTotal) where Year(InvoiceDate) < 2008 / Sum(InvTot) where Year(InvoiceDate) > 2007
Sum(InvoiceTotal) where Year(InvoiceDate) in (2010,2020)

Check the Filters section for more detail.

For Each Clause

Check the usage of the For each clause.

Functions

The following list of available functions can be used:

Examples

# Simple
Month(InvDate)
Upper(CustomerName)
# Composed
Trim(Str(Year(InvoiceDate)))

Availability

This behavior is available since GeneXus 16 Upgrade 11.


Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant