3 Replies Latest reply on Feb 9, 2017 1:06 AM by Donna Coles

# How can we find the customers who bought products in the years 2013&2014

I want to display customer names who bought products in the years 2013&2014

• ###### 1. Re: How can we find the customers who bought products in the years 2013&2014

Hi Gopi

Without knowledge of the structure of your data it's hard for anyone to give you an answer that will be known to work, as we'll all be making assumptions that may be incorrect - for example are your years stored in a field called year, or do you have separate fields for 2013 Sales, 2014 Sales for example...

Thanks

Donna

• ###### 2. Re: How can we find the customers who bought products in the years 2013&2014

Hi Donna,

I want those customer names who has sales value in the years 2013&2014?

I hope this time my question is clear for better understanding

• ###### 3. Re: How can we find the customers who bought products in the years 2013&2014

Hi Gopi

I've attached a solution (v10.1.1) but it may not be appropriate for your use case.  It does what you ask, just list customers for 2013 & 2014 but if you someone how needed this identified as part of a question on the whole data set, it might not work...

Basically I did the following :

1) Created a new dimension to store the Year of the order date Year of Order = YEAR([Order Date])

2) Created an LoD calculation to count the number of distinct years a customer had ordered Count No of Years Per Customer = {INCLUDE [Customer Name]: COUNTD([Year of Order])}.

3) Added a filter to just restrict the records to sales in 2013 or 2014

4) Then added a filter based on the LoD calc to only show records where the count was 2 which implied they must have ordered in both years.

Note - due to the way constructed above, you could easily find the customers ordered in all four years, or in 2014 and 2015 just by changing the filters on the final list.

Hope this helps

Regards

Donna