Help! Rollup or Group by: One Yes trumps any number of No values?
I have a difficult hierarchy logic I do not know how to handle in a load script.
Here is the example, I have a list of "Interest Mappings" beginning data pictured on left, records 1-10. I need to select the Code, Department, Product, and Interest but I need to let a 'Y' value trump all if there is a Y value. If all values for a Product type are N, then the Interest needs to be N. The end result should be as pictured on the right, records 1-6, where description is not included. Basically this is to loosen up over-restrictive Interest Mapping by saying, "well, you were interested in other Apple pieces in your Compost product, but you were being to picky."
The beginning two records have only one interest value for each product so those are kept. The next three values are the same code, same department, same Product, except there is one Y and N in the other two. I need the Y to be selected over any N. That would result in the record #3 in the Ending data example.
I would picture this as a regular Group By, to group past the Code Description, except for the condition that Y value should override all other values within the Product type.
I have absolutely no idea how to do this. Please help if you can!!
Re: Help! Rollup or Group by: One Yes trumps any number of No values?
Could I just clarify, it won't matter if there are more than one Y. In that case, should I have >=1 or does the =1 refer to the value Y being there at all, once or 5 times? I just don't want to exclude any that might have two Y values. I can hardly find anything on the use of an Only function in a load script.