I have a set of data that I would like to analyze. I am trying to locate customer visits that have visited a store two or more times in the past 12 months. And also, what product they bought two or more times in the past 12 months.
For instance,
Customer #8228 visited the store 3 times and bought 3 pants during that year.
<table class="MsoNormalTable" style="width: 148pt; margin-left: 5.15pt; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="247"> <tbody><tr style="height: 0.2in;"> <td style="width: 52pt; border: 1pt solid windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap"> Date
</td> <td style="width: 48pt; border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> Cust ID
</td> <td style="width: 48pt; border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> Product
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> Pants
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> Blouse
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> Shoes
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> T-shirt
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> Shoes
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> T-shirt
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> Pants
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> Pants
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> </td> <td style="width: 48pt; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> Pants
</td> </tr> </tbody></table>
For instance,
Customer #8228 visited the store 3 times and bought 3 pants during that year.
<table class="MsoNormalTable" style="width: 148pt; margin-left: 5.15pt; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="247"> <tbody><tr style="height: 0.2in;"> <td style="width: 52pt; border: 1pt solid windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap"> Date
</td> <td style="width: 48pt; border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> Cust ID
</td> <td style="width: 48pt; border-width: 1pt 1pt 1pt medium; border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="80" nowrap="nowrap"> Product
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap">
2/1/2010
8228
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap">
2/2/2010
4569
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap">
9/1/2010
8791
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap">
3/1/2010
5478
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap">
6/1/2010
8228
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap">
5/11/2010
5478
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap">
8/1/2010
8228
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap">
8/15/2010
3216
</td> </tr> <tr style="height: 0.2in;"> <td style="width: 52pt; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; padding: 0in 5.4pt; height: 0.2in;" valign="bottom" width="87" nowrap="nowrap">
1/11/2010
8228
</td> </tr> </tbody></table>