###

by **DAndres109@aol.com** » Tue May 06, 2008 2:54 pm

Ben,

That's a fair summary of my needs at this point.

Essentially, each row could have a set of variables (randomly valued) that can be referred to by expressions for selected columns, and each column can refer to other columns within the same row (to ensure that the figures match up).

I recently completed a project where I needed to ensure the following:

1. Given a randomly generated total Total T, calculate Quantity X as a percentage (between 0 and 20) of that total.

2. Quantity X is really the end result of a formula involving four table columns (referred to as A, B, C, and D), so I wanted to be able to distribute randomly across these four columns while still maintaining the rule that they must add up to Quantity X.

In this scenario, I first calculated the percentage I needed to obtain Quantity X, and calculated the other values based on random portions of this percent. For example, given:

X %: 15

A %: Random(0, X%)

B %: Random(0, X% - A%)

C %: Random(0, X% - A% - B%)

D %: X% - A% - B% - C%

All of which are then multiplied by Total T to get the values I need.

Hopefully, this can be more generalized then what is described here. I think it is complicated, but seems useful to be able to do for particularly hairy test-data-generation needs.

Thanks,

David