COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: CognosAdmn on 11 Nov 2009 12:59:54 AM

Title: count number of customer for each hour
Post by: CognosAdmn on 11 Nov 2009 12:59:54 AM
Hello All,

I am building a report to display the customer traffic for a retail store.
I have the following fields in my database. CustomerVisit, CustomerPurchaseDateTime, Product.

I need to develop a report for a certain product, depending on users selection, and display the number of customer who bought that product. this information should be displayed in the report for each hour the store is open.
so the report needs to display 10-11 --> 15 customers; 11-12 --> 20 customers; 12-1 --> 10 customers; etc. until 8-9 (PM).

Where I need help is to break the CustomerPurchaseDateTime into an hourly interval. and to assign the number of customers who visited the store during that interval. The report will be run for one day at a time.

Would someone please be able to help me out with this task?

Thank you in advance.
Title: Re: count number of customer for each hour
Post by: CognosAdmn on 12 Nov 2009 02:31:51 PM
Anyone Please?
Title: Re: count number of customer for each hour
Post by: cschnu on 12 Nov 2009 05:15:09 PM
First you must calculate what hour a given datetime falls in so:

extract(HOUR, [Invoice Payable].[Invoice].[INVOICE_DATE])

Then I think you just count that data item in your report

count(DataItemName)
Title: Re: count number of customer for each hour
Post by: CognosAdmn on 14 Nov 2009 12:23:16 AM
Thank you Sir. I appreciate your time and help.