If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Counting a Customer only Once and on the Day of their First Order

Started by buddtholomew, 03 Apr 2013 03:57:19 PM

Previous topic - Next topic

buddtholomew

Hi Gurus,

I would like some assistance with the following issue in RS. I would like to count CustomerID only once and on the first day they placed an order. In the below example, I would have 3 total customers, 2 on 04-01-2013 and 1 on 04-02-2013. Thanks for the help, Budd.

Order Date   CustomerID
04-01-2013  1001
04-01-2013  1002
04-02-2013  1001
04-02-2013  1003
04-30-2013  1001

blom0344

You can do this using 2 queries:
1. The one you got right now
2. A query that fetches the minimum value of the date for each customer
Join both queries within RS over the customer and the date as a 1:1 join.  Use the result query to build the report against..


buddtholomew

Quote from: blom0344 on 04 Apr 2013 02:38:50 AM
You can do this using 2 queries:
1. The one you got right now
2. A query that fetches the minimum value of the date for each customer
Join both queries within RS over the customer and the date as a 1:1 join.  Use the result query to build the report against..

Makes complete sense. Was attempting to accomplish in a single query. Appreciate the response.

Budd

seballen

You can do it in one query as well.

Create a data item called FirstOrderDate with the expression

minimum(Order Date for CustomerID)

and then set a filter in the query where OrderDate = FirstOrderDate

Thanks,
Sasha