## FilterValues, part 2

Sometimes it happens that the real value of a blog posting emerges in the comments section. Such was the case last time, when Paul Jansen posted an elegant little workaround to remedy a performance issue with the FilterValues function. Paul’s workaround is deserving of its own demo, and that’s what we’re going to look at today.

Demo file: filtering-values-v2.zip

## FilterValues

Today we’re going to do some experiments with the FilterValues function, which takes two return delimited lists for input…

``FilterValues ( textToFilter ; filterValues )``

…and produces the intersection of the two lists as output.

Level: Intermediate

## Exploring Problem Spaces

Given its primary role as a database product, it’s easy sometimes to forget what a great teaching tool FileMaker Pro can be. One of my favorite educational uses for it is building models to explore problem spaces, for example…

• viewing all possible outcomes for a problem with boundary conditions
• conducting trials to confirm the likelihood of a predicted outcome
• using “brute force” to find the solution to a complex problem

..and today we’re going to look at an example of each of these.

### Dice Roll

Demo Files: Dice Roll, v1 and Dice Roll, v2

## Generating Sample Data

Have you ever wanted to generate sample data for one of your solutions that was random in certain ways, but within a defined range or scope? For example, assuming an invoicing solution with existing tables of customers and products…

• choose 20 customers at random
• create between 4 and 8 invoices for each of them
• dated anywhere between 1 September and 31 December 2013
• choose products at random
• from the subset of products where price is between \$30 and \$50
• create between 5 and 25 line items per invoice
• with a quantity for each line item between 1 and 24

Wouldn’t it be nice to wave a magic wand to solve challenges like this? Well, I have some good news: Jesse Antunes and Geoff Coffey made that magic wand available, in the form of a custom function, back in 2007 on the SixFriedRice blog (Creating Random Numbers in FileMaker)… but I confess that I didn’t really grasp how useful it could be till Beverly Voth mentioned it in her article on Aggregates in Filtered Portals.