GCCTECHIE
asked on
MS Chart and displaying Monthly Sales Figures
Hi,
I'm pulling sales data from sql server 2005 express db, and i need to show each salesperson's monthly figures in a chart. The table data is as such...(just an example)
Salesperson | OrderDate | OrderAmount
Jack 12/1/2010 100
Jack 13/1/2010 50
Jane 1/2/2010 50
Jill 1/3/2010 50
Jack 5/3/2010 100
I created a view in the database to sum up the data and got this:
Salesperson | Month | Year | TotalOrder
Jack 1 2010 150
Jack 3 2010 100
Jane 2 2010 50
Jill 3 2010 50
The problem with this is that when i assign the x values and y values in the chart control, it will only take the available values in the query. What i wanted to show in the graph is that, for example, Jack sold 150 in Jan-2010, 0 in Feb-2010, and then 100 in Mar-2010.
Is there some way i can get around this? Maybe manually create the x-values, and then map the y-values to the manual x-values?
Thanks!
I'm pulling sales data from sql server 2005 express db, and i need to show each salesperson's monthly figures in a chart. The table data is as such...(just an example)
Salesperson | OrderDate | OrderAmount
Jack 12/1/2010 100
Jack 13/1/2010 50
Jane 1/2/2010 50
Jill 1/3/2010 50
Jack 5/3/2010 100
I created a view in the database to sum up the data and got this:
Salesperson | Month | Year | TotalOrder
Jack 1 2010 150
Jack 3 2010 100
Jane 2 2010 50
Jill 3 2010 50
The problem with this is that when i assign the x values and y values in the chart control, it will only take the available values in the query. What i wanted to show in the graph is that, for example, Jack sold 150 in Jan-2010, 0 in Feb-2010, and then 100 in Mar-2010.
Is there some way i can get around this? Maybe manually create the x-values, and then map the y-values to the manual x-values?
Thanks!
I supose you're grouping your query by orderDate month, you may try to use an IIF statement to create an empty values registry in the months where there is no records
ASKER
Hi Bardo,
did you mean in the query or in the chart settings?
did you mean in the query or in the chart settings?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi bardo,
sorry i took so long. i have been trying, to no success.
sorry i took so long. i have been trying, to no success.
Did you get a query with the 12 months for every salesperson?
ASKER
Thanks!
I ended up with four queries to get the end result, one on top of another...but i managed to get it to work.
I ended up with four queries to get the end result, one on top of another...but i managed to get it to work.