Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I count the number of days in a month?

Status
Not open for further replies.
Mar 16, 2001
11
0
0
GB
Hi,

I am trying to create a variable in my report which will return the number of times each day (Mon, Tue, Wed...) appears in a date range.

My report wants to show average sales made by day of week (DOW). So to do this I need to take the total sales made on Mondays for instance, and divide it by the number of Mondays in the month.

So far I have the date (from the data provider) and a number for the DOW (from the function DayNumberOfWeek()).

Then I planned on using the function Count(<DOW>) to return the number of times each DOW appeared in the month. But this does not work! It always returns the number 1 only.

I have tried all types of extended syntax I can think of like Count(<DOW>)ForAll(<Date>) as I thought BO may just be showing me how many days there are on each date which is of course only 1, but nothing like this works either!

Any help or suggestions would be gratefully received!

Cheers.
 
First: <DOW> must be Dimension, not Measure, to allow BO
to make automatically the agregation of duplicates.

I think the problem is that you are indicating the exit
context (the context AFTER the agregation function is evaluated), but not the entry context (the context BEFORE the agregation function is evaluated). Try one of these:
Count(<DOW> ForAll (<Date>))
Count(<DOW> In Report)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top