Suppose I have the following table:
Customer | Product | Profit | Flag |
A | 1 | 100 | True |
A | 2 | 150 | True |
B | 1 | 100 | False |
If the flag is True for a customer it is True for all instances of that Customer. Likewise if it is false.
And I would like to do a logical test something like:
If Customer grouped by flag = True
Generate 1 row for Customer with product 3 where profit 200
else
do nothing to the customer
endif
So I would get the following output from the example above:
Customer | Product | Profit | Flag |
A | 1 | 100 | True |
A | 2 | 150 | True |
A | 3 | 200 | True |
B | 1 | 100 | False |
How would I go by creating this?
Sorry for the terrible pseudocode. Thanks in advance!
Solved! Go to Solution.
Here's an example of one option that does what you describe, though I suspect your logic might end up being a bit more complicated.