I'm using CR2011 with a SQL Server db as my data source. I'm working for a startup that's developed an app to hail cabs and limos. Because of some messy data, I'm having problems creating a report with an accurate count of cancelled orders. If the source of the order is dispatch, a distinct count of order id will work. However, if the source is a mobile phone, there can be multiple cancelled order id's for a single customer session. There is no session id in the database, but the user id is associated to each cancelled order entry. Here is a sample of the data:
Order Id Date/Time Address User ID
1171 5/1/2012 5:00:01PM 1861 Hyde St mw@yahoo.com
1172 5/1/2012 5:01:36PM 1861 Hyde St mw@yahoo.com
1173 5/1/2012 5:02:45PM 1895 Hyde St mw@yahoo.com
1174 5/1/2012 5:03:12PM 650 Mission St rider1@aol.com
1175 5/1/2012 5:04:15PM 1925 Hyde St mw@yahoo.com
1252 5/3/2012 9:45:16PM 425 1st St mw@yahoo.com
1253 5/3/2012 9:48:49PM 652 Polk rider1@aol.com
1254 5/3/2012 9:48:52PM 498 1st St mw@yahoo.com
Because the same user can order a cab multiple times per day, I've grouped the data by City, Fleet, Order Date(by day), Order Date(by hour), then by user id. Grouping by user id and hour creates a customer "session" and the total number of user groups by hour represent the number of actual customer sessions or orders. Once I have this grouping, I can only do a running total using distinct counts, but the counts get screwed up when I look at a month's worth of data. Is there any way to use a formula to create a unique user session id that I can use for counts?? Given the data limitations, what's the best way to get an accurate count of cancelled orders??
Order Id Date/Time Address User ID
1171 5/1/2012 5:00:01PM 1861 Hyde St mw@yahoo.com
1172 5/1/2012 5:01:36PM 1861 Hyde St mw@yahoo.com
1173 5/1/2012 5:02:45PM 1895 Hyde St mw@yahoo.com
1174 5/1/2012 5:03:12PM 650 Mission St rider1@aol.com
1175 5/1/2012 5:04:15PM 1925 Hyde St mw@yahoo.com
1252 5/3/2012 9:45:16PM 425 1st St mw@yahoo.com
1253 5/3/2012 9:48:49PM 652 Polk rider1@aol.com
1254 5/3/2012 9:48:52PM 498 1st St mw@yahoo.com
Because the same user can order a cab multiple times per day, I've grouped the data by City, Fleet, Order Date(by day), Order Date(by hour), then by user id. Grouping by user id and hour creates a customer "session" and the total number of user groups by hour represent the number of actual customer sessions or orders. Once I have this grouping, I can only do a running total using distinct counts, but the counts get screwed up when I look at a month's worth of data. Is there any way to use a formula to create a unique user session id that I can use for counts?? Given the data limitations, what's the best way to get an accurate count of cancelled orders??