Help filtering records

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Help filtering records

Mark Palmberg-2
I have a dataset that contains information on donors to my ogranization.
In order to maintain as much granularity of my data as possible, spouses
are listed separately; i.e., if both spouses are in our database,
there's a record in my dataset for each one (rather than "stacked," or
by household).
 
My problem:  Joint gifts.  Sometimes a couple gives a gift for which
they each get equal credit for recognition purposes.  This becomes
problematic when trying to figure mean historical giving values for
different groups in the dataset (mean values are higher than they should
be because the same gift is getting counted twice when it was only made
once).
 
What I'd like to do is somehow isolate and then filter out records that
have spouses who have identical TOTAMT values.  Each record has an MSTID
(master ID) variable, an SPSEID (spouse ID) variable, and the
aforementioned TOTAMT variable, among others.
 
Any thoughts are greatly appreciated.
 
Mark
Reply | Threaded
Open this post in threaded view
|

Re: Help filtering records

Maguin, Eugene
Mark,

I think this will do it. I'm assuming that MSTID is 'family' id variable
such that both spouses have the same value. I'm also going to asume that no
more than two records have the same mstid value. Meaning that you may have a
person and their spouse but not a person, their spouse, and one of their
children.

Sort cases by mstid spseid.

Compute mark=0.
Do if (mstid eq lag(mstid)).
+  if (totamt eq lag(totamt)) mark=1.
End if.
Execute.


Gene Maguin