Jump to content
Server Maintenance This Week. ×

Monthly Sales Line graph


AgentsSka

This topic is 4151 days old. Please don't post here. Open a new topic instead.

Recommended Posts

It must be the season... but my brain is fried and I'm not seeing how to create this line chart.

 

I have a database with two years of orders in it.

 

I'd like to create a line graph that shows the number of orders/month.  One line per year.

 

What calculations do I need to create, and what kind of self-joins might I need to create such a table?

Link to comment
Share on other sites

I would use a script to compile the data with Fast Summaries method, store it in return-delimited global variables, then use those variables as the data source for the graph.

 

If you only wanted one year at a time it wouldn't be too difficult to use calculated fields/relationships to get the data, but since you want a series for each year, the scripted method will give you the flexibility you need without having to create a bunch of extra fields/TO's.

Link to comment
Share on other sites

I have a database with two years of orders in it.

 

I'd like to create a line graph that shows the number of orders/month.  One line per year.

 

It depends on what do you want to do when your data grows to include three or more years. Will the chart always compare two years?

  • Like 1
Link to comment
Share on other sites

Well, that's kind of problematic, because the chart setup requires an explicit expression for each series (line). IOW, you can preset the chart for say 10 years, but you cannot make the chart automatically add a line for the 11th year (not even through a scripted process).

Link to comment
Share on other sites

Well, that's kind of problematic, because the chart setup requires an explicit expression for each series (line). IOW, you can preset the chart for say 10 years, but you cannot make the chart automatically add a line for the 11th year (not even through a scripted process).

Hmm... Ok, so I'd have to update the chart each New Year.

Link to comment
Share on other sites

Or revise your process... If you continue down this road, imagine what your chart will look like in 30 years.

Ok.  I see your point.  However, I was never intending on having 30 years of data on one chart.

 

Let's say, I'd like to max it at three years.  And, for arguments sake, say that the data was 2010, 2011, & 2012.  Once we get into 2013, 2010 would drop off and 2013 would replace it on the chart.

 

I'm still not sure the best way to organize the data.

Link to comment
Share on other sites

Thanks.  This does seem pretty straight forward.

 

I've set up a portal similar to what you have created and the info displays properly.

portal2.png

 

However, the chart does not display correctly.  And, it takes forever to load before displaying this:

portal.png

As expected, the calculations that are in for the Y axis return the following:

 

Series 1 - LeftValues ( List ( Orders per Month::cCount ) ; 12 )

 

257
167
138
144
166
113
79
211
265
955
4425
5463
 

 

Series 2 - MiddleValues ( List ( Orders per Month::cCount ) ; 13 ; 12 )

 

426
276
323
333
419
363
283
414
517
1199
5230
4975
 
While trouble shooting, I even dropped series 3 from the chart because there is no data for those dates yet.  That still didn't fix the issue.  The results are similar to the above image.
 
Any idea why the chart would be failing?
 
Link to comment
Share on other sites

This topic is 4151 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.