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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating Dates to Appear Chronologically in a Graph 1

Status
Not open for further replies.

mdcson

Technical User
Jan 19, 2011
38
US
I have a graph that is formatted to show the following date format:
Jan-11, Feb-11, Mar-11, etc, for example.

I have converted the table date data in the following manner:

@ToDate = cdate({@Year},{@MonthConvert},01) where
@Year = tonumber({tbl_Convert_Calendar_to_Fiscal.Calendar_Year})
@MonthConvert = tonumber({@Month})

I am graphing the formula @ToDateF :cstr({@ToDate},"MMM-yy") in order to give me the Jan-11 format.

For the most part, this works. However, when a new month of data comes in, that new month either appears as "Other" or is sorted incorrectly. How do I program this so that Crystal automatically recognizes the proper chronological order?

The idea is to automate reports so that everything becomes automatically generated month after month. Currently, after every month, I have to go in and modify these date issues by adding in the new month under the OnChangeOf order button.
 
I don't quite understand the response. I am just developing reports via Crystal using Crystal syntax and just need to know, based upon my formulas, if and how I can get it to recognize dates in chronological order.

Every time a new month of data comes in, that new month is either relegated to "other", is not included in the graph, or is sorted incorrectly if it is included.
 
I have figured out the issue for those that may come across this issue in the future. Here is the solution that worked in my case:

1)I did a right click on my chart to go into chart expert and changed my chart type from line chart to Numeric Axis, selecting the Date Axis Line Chart.

2)I selected and right clicked on one of the dates that appeared in the x-axis and selected Group X-axis options, clicked on Numbers and chose my desired format after making sure that the category was set to "Date" (In my case, I selected the Feb-02 option under the Date category).

By doing this, my dates did appear and in the right format, however, the default setting is to show every two months. If that is fine for you then you are good to go at that stage. In my case, I wanted a label for every month to show. To do this, in that same menu (Group X-axis settings), select Scales then click on major unit and change the default two months to one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top