on 2010 Dec 08 4:14 PM
Is there a way to display ALL 12 months (including future months) in a Crystal Reports chart, when the raw data does not include all 12 months. The issue I am running into is that I have a small data set and it only displays the months from the date field selected for the chart. The following is an example of the months displayed:
January
March
June
July
September
November
Is it possible to display the "missing" months on a Crystal Reports chart? If so, how do I force the missing month's values?
If it's not possible, would someone please reply to this post to validate my thoughts.
Thank you in advance for your help!
There is a way to do this - I have seen it posted here but I do not remember. Try searching for it. If I find it, I will be back
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello LuAnn, Debi, & Jason,
i have attached a sample report wherein the chart uses a set of formulae so that each month is populated and you don't need to change your database...although changing the database to have a set of good lookup tables is always best
you can copy the formulae to your existing report, change the formulae variables to match your fields, and then change your chart to match the sample.
you could also bring in this sample as a subreport to your existing report and then copy the chart itself over to the main report if you want.
please note that since you would be using a chart with multiple series, that the labels don't show up as desired...in the sample i have created another set of formulae that you can use for the labels.
cheers,
jamie
hi Debi,
i just found out from the powers that be that look after sdn...you have to be a forum "moderator" in order to post attachments to forums. which is too bad as there are many people such as yourself who provide tons of valuable answers and assistance for the forums and a sample report can be worth much more than a thousand words. plus it's easier to put some code into a .txt object so that the forum post doesn't mangle it.
if you wish i can find out how you can become a moderator...the bad part of that is that a moderator has specific requirements for forum tasks.
jamie
>
> hi Debi,
>
> i just found out from the powers that be that look after sdn...you have to be a forum "moderator" in order to post attachments to forums. which is too bad as there are many people such as yourself who provide tons of valuable answers and assistance for the forums and a sample report can be worth much more than a thousand words. plus it's easier to put some code into a .txt object so that the forum post doesn't mangle it.
>
> if you wish i can find out how you can become a moderator...the bad part of that is that a moderator has specific requirements for forum tasks.
>
> jamie
Thank you Jamie for the vote of confidence to think I could be a moderator. I'm not sure I have sufficient knowledge to do this, but if I had the time to dedicate to it, I would try.
Hi Jamie,
I clicked on the link for the zip file and it appeared it was downloading. However when it was finished nothing popped up on my screen to extract the winzip file.
Would you mind pasting the formulas in the thread? I have the BO Client Tool Suite 3.1 on my machine and ran into several issues with the install. I am afraid if I download the latest CR 2008 patch that something will break in the client tools. Please let me know. Thanks again!!!!!
formula 1
// set the 2 variables below to your fields
datetimevar dtv:= {Orders.Order Date};
numbervar nv:= tonumber({Orders.Order Amount});
// you don't need to change the code below
if month(dtv) = 1
then nv
formula 2
datetimevar dtv:= {Orders.Order Date};
numbervar nv:= tonumber({Orders.Order Amount});
if month(dtv) = 2
then nv
repeat for all other months
put all 12 in a new chart
manually create labels for the bottom of the chart.
jw
Hi Jamie,
I created 12 different formulas (changed the variables according to my report) for each month and called them DateJan, DateFeb, and so on. I inserted a new chart, on the Data tab I selected the database date field under "On Change Of", and under Show Values is where I listed the counts of DateJan, DateFeb, etc. and something isn't right. It's a bar chart, and there are several bars under each month, and it still does not display the missing months. Please advise. Thanks!
Hi again,
I figured out the issue - it was with the data. I needed perform counts on ticket numbers by month. I wrote additonal formulas against the variable formulas you sent me and that worked!
Two final questions - how do I create manual labels at the bottom of the chart? Is that as simple as inserting a text box? When I changed from bar chart to a line chart I didn't see the line - only numbers and they were stacked - do you know why that is? Please let me know, and THANKS again for all your help!!!!!
hi LuAnn,
you will indeed have to build the labels manually using text objects.
unfortunately you can't use a line chart as you have to use 12 different Show Values / Series in order to have the spacing for each bar when there's no data. each series has only 1 value and therefore no lines, just a single point for each series.
perhaps you can plead your case to your database administrator to add in a date lookup table. the best solution for report development is to always have a lookup table in the database that has all dates within the many years that you would report off of. you can then avoid annoying workarounds related to missing data like this one
cheers,
jw
It all depends on what's available in your current data set. Does your data set have a month column?... or is it being calculated from a full date field?
Jason
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.