Active Query Builder support area

How to best handle mandatory conditions

Avatar
  • updated
  • Completed

I doing the ground work for a CustomExpression builder

Forgetting that for the moment using the Criteria and Or columns how would you handle what I would call mandatory conditions

Simple example

You have table with fields for Total Sales, Area, Category

You want to ask of the database return me all the Total computer and TV sales that are above £100 for the following areas B1 B2 G1 G2

so in SQL

WHERE (TotalSales>100 and (Category='Computers' or Category='TV')) AND (Area='B1' or Area='B2' or Area='G1' or Area='G2')

This is an over simple example and yes I could have used the IN operator but I wanted to emphasize the mix of and's and or's

I assume all of this would have to go in the criteria cell because the Or columns are only ever Or'd with the Criteria and each other ?

If that is the case then perhaps an option to turn off the Or columns when using the custom expression builder as they probably have limited use ?

Avatar
Andrew Kennard

Thanks I thought I was missing something

Avatar
Andrew Kennard

It should also tick the column in the table if appropriate as it does now if you choose from combo

Thanks in advance

Avatar
Sergey Kraikov

I have changed the behaviour of the "Select" cell for the new rows.

Now it is checked for the new rows even if the expression entered by using custom expression editor.

The fix will be included in the next build.

Avatar
Andrew Kennard

Thanks very much.

I will test it when it is released along with the others that were done today. Thanks

Avatar
Andrey Zavyalov, PM

This fix is included in the newly released version.

Avatar
Andrew Kennard

I've not tested extensively but this does seem to work ticking both the Output column and the field in the Table

It doesn't tick the table if it is an expression eg RTrim(table.field) which is fair enough as there may or may not be a field within the expression