Relational expressions

Returns a boolean value, True or False, based on whether the relation specified by the relational operator is satisfied or not.

Generic syntax:

| process eval("identifier = first_operand relational_operator second_operand")

Less than (<)

Compares two operands. It returns true if the first operand is less than the second operand, or false if the first operand is greater than the second.

Example:

| process eval("is_loss=Selling_price<cost_price")
| chart count() by Selling_price, cost_price, is_loss
_images/less_than.png

Using Less than function

Here, the query compares the cost_price and Selling_price field values. It returns true in the is_loss identifier if the cost_price is less than the Selling_price, if it isn’t it returns false.

The chart count() displays the count of the combination of cost_price and Selling_price values as a chart and in a tabular form.

Greater than (>)

Compares two operands. It returns true if the first operand is greater than the second operand or returns false if the first operand is less than the second.

Example:

| process eval("is_profit=Selling_price>cost_price")
| chart count() by Selling_price, cost_price, is_profit
_images/greater_than.png

Using Greater than function

Here, the query compares the Selling_price and cost_price fields value. It returns true in the is_profit identifier if the Selling_price is greater than the cost_price, if it isn’t it returns false.

The chart count() displays the count of the combination of Selling_price, cost_price, and is_profit values as a chart and in a tabular form.

Less than or equal to (<=)

Compares two operands. It returns True if the first operand is less than or equal to the second operand, if it isn’t it returns False.

Example:

| process eval("is_less_discount=discount<=50")
| chart count() by discount, is_less_discount
_images/less_than_equals.png

Using Less than or equals function

Here, the query compares the discount field value with 50. It returns true in the is_less_discount identifier if the discount is less than or equal to 50, if it isn’t it returns false.

The chart count() displays the count of the combination of discount and is_less_discount values as a chart and in a tabular form.

Greater than or equal to (>=)

Compares two operands. It returns true if the first operand is greater than or equal to the second operand, if it isn’t it returns false.

Example:

| process eval("is_more_discount=discount>=51")
| chart count() by discount, is_more_discount
_images/greater_than_equals.png

Using Greater than or equals function

Here, the query compares the discount field value with 51. It returns true in the is_more_discount identifier if the discount is greater than or equal to 51, if it isn’t it returns false.

The chart count() displays the count of the combination of discount and is_more_discount values as a chart and in a tabular form.

Not equal to (!=)

Compares two operands. It returns true if the first operand is not equal to the second operand, if it isn’t it returns false.

Example:

| process eval("is_profit_or_loss=Selling_price!=cost_price")
| chart count() by Selling_price, cost_price, is_profit_or_loss
_images/not_equals.png

Using Not equals function

Here, the query compares the Selling_price field value with the cost_price field. It returns true in the is_profit_or_loss identifier if the Selling_price is not equal to the cost_price, if it is it returns false.

The chart count() displays the count of the combination of Selling_price, cost_price and is_profit_or_loss values as a chart and in a tabular form.

Equal to (==)

Compares two operands. It returns true if the first operand is equal to the second operand, if it isn’t it returns false.

Example:

| process eval("no_profit_or_loss=Selling_price==cost_price")
| chart count() by Selling_price, cost_price, no_profit_or_loss
Equals function

Using Equal to function

Here, the query compares the Selling_price field value with the cost_price field. It returns true in the no_profit_or_loss identifier if the Selling_price is equal to the cost_price, if it isn’t it returns false.

The chart count()* displays the count of the combination of **Selling_price, cost_price, and no_profit_or_loss values as a chart and in a tabular form.


Helpful?

We are glad this guide helped.


Please don't include any personal information in your comment

Contact Support