Nested Parentheses in BAQ Subquery Criteria?


Is this the best way to nest subquery criteria? We used the company field as a placeholder. Is there a better option?

Since you’re already using SubQuery criteria, you are able to use calculated fields in your expression. Create a calculated field that returns true, yes, etc. when you want to select that record and just use it to select your record.

I’m sorry, I don’t get it. I can see moving the subquery criteria out to the individual subqueries. You are suggesting to make another calculated field to filter the records we want. I am not sure what you mean.

If I am reading the criteria we have correctly, it should say:
(
labor type = S AND Hours > 0
OR
labor type = P and Mins > 0
)
AND
(
OpSeq <> 0
AND
ResGrp <> 10MB, 9, FP, MP
AND
JobClose >= 1/1/2010
)

Create a calculated field of type nvarchar(1) with the exact criteria above. If it validates to true, set it to “Y” else “N”.

In your subQuery Criteria, under tables choose Calculated Fields, then select your calculated field. Check if that field is equal to “Y”.

3 Likes

That makes sense! Is that a better way than what we have currently, or just a different way? Also this doesn’t really answer the request to have double parentheses, it just sidesteps the request. That is fine by me, I am just curious what is the best way?

IDK, having just one line in the criteria seems easier to enter and you can do some real complicated selection criteria that reads much easier in a calculated field. Double parenthesis are much easier and clearer in an expression than a subQuery criteria. :person_shrugging:

1 Like

You can type in more parens if you need them. Is that what you’re looking for?

6 Likes

Then there’s this! Nice Mark.

1 Like

Love learning this stuff. I can’t believe I’ve never needed this.

1 Like

How did we miss that? I think it is because it isn’t obvious that you can type in there with the drop down! Awesome!!

1 Like

It’s that way in classic too. I went to go test it, because if they missed that, I was gonna put in a ticket. But they didn’t.

4 Likes

also literally anything else.

5 Likes

Always Sunny Shut Up GIF

2 Likes

:wink:

2 Likes

mel brooks password GIF

1 Like

And to think you don’t like widgets…
:laughing: