Occasions may arise where your filtering needs are far more intricate than simply using an AND statement or an OR statement. Sometimes you might need to use a mixture of both. Thankfully Sage Intacct knows this and has included the functionality that makes this possible through custom expressions!
A good example of a situation where you’d want a custom expression is when you’re looking for all Active Vendors in New York State and Pennsylvania State. Just as we did in the past we will select our filter fields, operators and value for our 3 criteria as shown below:
Now that we have all of our filter values set up we need to understand how to write this more advanced expression. How do we even know we should be using this more advanced functionality? First we will think of our criteria using the AND operator. If we joined the above three statements with an AND we’d be looking for vendors who are in New York AND in Pennsylvania AND have a status of Active. Is that possible? Can a Vendor have an address of New York State and Pennsylvania at the same time? No, they sure can’t, so this statement would return nothing.
Next we should think of what we would get if our filters were joined together by OR statements. Are we looking for vendors in New York State OR in Pennsylvania OR those who have a status of active? What this expression would give us in all Vendors in both New York and Pennsylvania no matter what their status is and all active vendors no matter what their state is. Is that what we want? Definitely not! What we are looking for is all Active Vendors in New York State and Pennsylvania State.
Thinking of the expression in this way is what tells us that for this example we need something more powerful. A mixture of AND and OR statements will be. In order to use a mixture of statements we must select the ‘Expression’ option from the Condition type dropdown. Once the Expression option is select, the Condition text box below it will be active. The condition box is where we will type our more advanced Expression.
Join us next week to learn about how to piece together an advanced filter expression.