Help in Sales Analysis - Northwind template

  • Thread starter Coco111 via AccessMonster.com
  • Start date
C

Coco111 via AccessMonster.com

Anybody Please help... Sorry again, in Northwind template 2007. I found
something wrong in sales Analysis, but I dont know how to solve.

Queries of sales analysis show below-

MonthOfQuarter: (Month([Order Date]) Mod 3), in data sheet view oct = 1, Nov
= 2, Dec = 0 and sales of Dec did not show up. I guess Dec should be 3, if
im not wrong. What do you think and how to solve the problem. The sales of
dec month did not show up...it shows no sales or 0 in quarter sales report
summary. Thank you.
 
J

John Spencer

If you are going to use MOD to number the months from 1 to 3, then try the
following expression.

((Month([Order Date])-1) MOD 3) + 1

MOD 3 will return 0, 1, or 2 and you want 1, 2, and 3 so you need to add 1 to
the result of the Mod Operation.

You also want 1,4,7 and 10 to return zero when using MOD so you need to
subtract 1 before using MOD so you get
0 for months 1,4,7,10
1 for months 2,5,8,11
2 for months 3,6,9,12

Then you add 1 to the result to get 1,2, or 3.

This may or may not fix the fact that sales for December do not show up. I
suggest you post the SQL of the query you are using.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
C

Coco111 via AccessMonster.com

Hi John,

I change expression ((Month([Order Date])-1) MOD 3) + 1 as suggested....

It works....Absolute right, you are great...fast response and help me solve
problem...i can see the sales of dec in report now..

But...now, im in Q4, if in Jan'10 Q1 what I need to do next or do nothing...
But im not very clear about your below advice

You also want 1,4,7 and 10 to return zero when using MOD so you need to
subtract 1 before using MOD so you get
0 for months 1,4,7,10
1 for months 2,5,8,11
2 for months 3,6,9,12

Then you add 1 to the result to get 1,2, or 3.

Sorry and thanks....Coco111



John said:
If you are going to use MOD to number the months from 1 to 3, then try the
following expression.

((Month([Order Date])-1) MOD 3) + 1

MOD 3 will return 0, 1, or 2 and you want 1, 2, and 3 so you need to add 1 to
the result of the Mod Operation.

You also want 1,4,7 and 10 to return zero when using MOD so you need to
subtract 1 before using MOD so you get
0 for months 1,4,7,10
1 for months 2,5,8,11
2 for months 3,6,9,12

Then you add 1 to the result to get 1,2, or 3.

This may or may not fix the fact that sales for December do not show up. I
suggest you post the SQL of the query you are using.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Anybody Please help... Sorry again, in Northwind template 2007. I found
something wrong in sales Analysis, but I dont know how to solve.
[quoted text clipped - 6 lines]
dec month did not show up...it shows no sales or 0 in quarter sales report
summary. Thank you.
 
J

John Spencer

Do nothing. The "advice" was simply an explanation of how the expression
worked to give you month number of the quarter

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Hi John,

I change expression ((Month([Order Date])-1) MOD 3) + 1 as suggested....

It works....Absolute right, you are great...fast response and help me solve
problem...i can see the sales of dec in report now..

But...now, im in Q4, if in Jan'10 Q1 what I need to do next or do nothing...
But im not very clear about your below advice

You also want 1,4,7 and 10 to return zero when using MOD so you need to
subtract 1 before using MOD so you get
0 for months 1,4,7,10
1 for months 2,5,8,11
2 for months 3,6,9,12

Then you add 1 to the result to get 1,2, or 3.

Sorry and thanks....Coco111



John said:
If you are going to use MOD to number the months from 1 to 3, then try the
following expression.

((Month([Order Date])-1) MOD 3) + 1

MOD 3 will return 0, 1, or 2 and you want 1, 2, and 3 so you need to add 1 to
the result of the Mod Operation.

You also want 1,4,7 and 10 to return zero when using MOD so you need to
subtract 1 before using MOD so you get
0 for months 1,4,7,10
1 for months 2,5,8,11
2 for months 3,6,9,12

Then you add 1 to the result to get 1,2, or 3.

This may or may not fix the fact that sales for December do not show up. I
suggest you post the SQL of the query you are using.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Anybody Please help... Sorry again, in Northwind template 2007. I found
something wrong in sales Analysis, but I dont know how to solve.
[quoted text clipped - 6 lines]
dec month did not show up...it shows no sales or 0 in quarter sales report
summary. Thank you.
 
C

Coco111 via AccessMonster.com

Noted, and many thanks....

John said:
Do nothing. The "advice" was simply an explanation of how the expression
worked to give you month number of the quarter

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
[quoted text clipped - 45 lines]
 
T

Tim Prescott

John,
I've seen your response to this query in numerous forums. Thanks for the easy fix....EXCEPT I'm a VB novice. Where exactly do I find the expression to replace with your expression: ((Month([Order Date])-1) MOD 3) + 1

Thank you!
Tim



John Spencer wrote:

If you are going to use MOD to number the months from 1 to 3, then try
16-Dec-09

If you are going to use MOD to number the months from 1 to 3, then try th
following expression

((Month([Order Date])-1) MOD 3) +

MOD 3 will return 0, 1, or 2 and you want 1, 2, and 3 so you need to add 1 t
the result of the Mod Operation

You also want 1,4,7 and 10 to return zero when using MOD so you need t
subtract 1 before using MOD so you ge
0 for months 1,4,7,1
1 for months 2,5,8,1
2 for months 3,6,9,1

Then you add 1 to the result to get 1,2, or 3

This may or may not fix the fact that sales for December do not show up.
suggest you post the SQL of the query you are using

John Spence
Access MVP 2002-2005, 2007-200
The Hilltop Institut
University of Maryland Baltimore Count

Coco111 via AccessMonster.com wrote:

Previous Posts In This Thread:

Help in Sales Analysis - Northwind template
Anybody Please help... Sorry again, in Northwind template 2007. I foun
something wrong in sales Analysis, but I dont know how to solve

Queries of sales analysis show below

MonthOfQuarter: (Month([Order Date]) Mod 3), in data sheet view oct = 1, No
= 2, Dec = 0 and sales of Dec did not show up. I guess Dec should be 3, i
im not wrong. What do you think and how to solve the problem. The sales o
dec month did not show up...it shows no sales or 0 in quarter sales repor
summary. Thank you

-


If you are going to use MOD to number the months from 1 to 3, then try
If you are going to use MOD to number the months from 1 to 3, then try th
following expression

((Month([Order Date])-1) MOD 3) +

MOD 3 will return 0, 1, or 2 and you want 1, 2, and 3 so you need to add 1 t
the result of the Mod Operation

You also want 1,4,7 and 10 to return zero when using MOD so you need t
subtract 1 before using MOD so you ge
0 for months 1,4,7,1
1 for months 2,5,8,1
2 for months 3,6,9,1

Then you add 1 to the result to get 1,2, or 3

This may or may not fix the fact that sales for December do not show up.
suggest you post the SQL of the query you are using

John Spence
Access MVP 2002-2005, 2007-200
The Hilltop Institut
University of Maryland Baltimore Count

Coco111 via AccessMonster.com wrote:

Hi John,I change expression ((Month([Order Date])-1) MOD 3) + 1 as suggested...
Hi John

I change expression ((Month([Order Date])-1) MOD 3) + 1 as suggested...

It works....Absolute right, you are great...fast response and help me solv
problem...i can see the sales of dec in report now.

But...now, im in Q4, if in Jan'10 Q1 what I need to do next or do nothing..
But im not very clear about your below advic

You also want 1,4,7 and 10 to return zero when using MOD so you need t
subtract 1 before using MOD so you ge
0 for months 1,4,7,1
1 for months 2,5,8,1
2 for months 3,6,9,1

Then you add 1 to the result to get 1,2, or 3

Sorry and thanks....Coco11


John Spencer wrote

-
Message posted via AccessMonster.co


Do nothing.
Do nothing. The "advice" was simply an explanation of how the expressio
worked to give you month number of the quarte

John Spence
Access MVP 2002-2005, 2007-200
The Hilltop Institut
University of Maryland Baltimore Count

Coco111 via AccessMonster.com wrote:

Noted, and many thanks....
Noted, and many thanks...

John Spencer wrote:

--




Submitted via EggHeadCafe - Software Developer Portal of Choice
C# And The Little Iterator That Could
http://www.eggheadcafe.com/tutorial...32-0ae26adaa533/c-and-the-little-iterato.aspx
 
J

John Spencer

It depends on where you want to generate the month of the quarter.

In a query, you might have a calculated field to generate the month of the
quarter.

Field: MonthQuarter: ((Month([SomeDateField])-1) MOD 3) + 1

You could even use it in a more complex expression to Get quarter followed by
month. March would be Q2-1 (for first month of quarter 2)

Field: QM: "Q" & Format([SomeDateField],"q") & "-" &
((Month([SomeDateField])-1) MOD 3) + 1

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Tim said:
John,
I've seen your response to this query in numerous forums. Thanks for the easy fix....EXCEPT I'm a VB novice. Where exactly do I find the expression to replace with your expression: ((Month([Order Date])-1) MOD 3) + 1

Thank you!
Tim



John Spencer wrote:

If you are going to use MOD to number the months from 1 to 3, then try
16-Dec-09

If you are going to use MOD to number the months from 1 to 3, then try the
following expression.

((Month([Order Date])-1) MOD 3) + 1

MOD 3 will return 0, 1, or 2 and you want 1, 2, and 3 so you need to add 1 to
the result of the Mod Operation.

You also want 1,4,7 and 10 to return zero when using MOD so you need to
subtract 1 before using MOD so you get
0 for months 1,4,7,10
1 for months 2,5,8,11
2 for months 3,6,9,12

Then you add 1 to the result to get 1,2, or 3.

This may or may not fix the fact that sales for December do not show up. I
suggest you post the SQL of the query you are using.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Coco111 via AccessMonster.com wrote:

Previous Posts In This Thread:

Help in Sales Analysis - Northwind template
Anybody Please help... Sorry again, in Northwind template 2007. I found
something wrong in sales Analysis, but I dont know how to solve.

Queries of sales analysis show below-

MonthOfQuarter: (Month([Order Date]) Mod 3), in data sheet view oct = 1, Nov
= 2, Dec = 0 and sales of Dec did not show up. I guess Dec should be 3, if
im not wrong. What do you think and how to solve the problem. The sales of
dec month did not show up...it shows no sales or 0 in quarter sales report
summary. Thank you.

--


If you are going to use MOD to number the months from 1 to 3, then try
If you are going to use MOD to number the months from 1 to 3, then try the
following expression.

((Month([Order Date])-1) MOD 3) + 1

MOD 3 will return 0, 1, or 2 and you want 1, 2, and 3 so you need to add 1 to
the result of the Mod Operation.

You also want 1,4,7 and 10 to return zero when using MOD so you need to
subtract 1 before using MOD so you get
0 for months 1,4,7,10
1 for months 2,5,8,11
2 for months 3,6,9,12

Then you add 1 to the result to get 1,2, or 3.

This may or may not fix the fact that sales for December do not show up. I
suggest you post the SQL of the query you are using.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Coco111 via AccessMonster.com wrote:

Hi John,I change expression ((Month([Order Date])-1) MOD 3) + 1 as suggested...
Hi John,

I change expression ((Month([Order Date])-1) MOD 3) + 1 as suggested....

It works....Absolute right, you are great...fast response and help me solve
problem...i can see the sales of dec in report now..

But...now, im in Q4, if in Jan'10 Q1 what I need to do next or do nothing...
But im not very clear about your below advice

You also want 1,4,7 and 10 to return zero when using MOD so you need to
subtract 1 before using MOD so you get
0 for months 1,4,7,10
1 for months 2,5,8,11
2 for months 3,6,9,12

Then you add 1 to the result to get 1,2, or 3.

Sorry and thanks....Coco111



John Spencer wrote:

--



Do nothing.
Do nothing. The "advice" was simply an explanation of how the expression
worked to give you month number of the quarter

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Coco111 via AccessMonster.com wrote:

Noted, and many thanks....
Noted, and many thanks....

John Spencer wrote:

--




Submitted via EggHeadCafe - Software Developer Portal of Choice
C# And The Little Iterator That Could
http://www.eggheadcafe.com/tutorial...32-0ae26adaa533/c-and-the-little-iterato.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top