I have created a set of arrays in my Crystal report. I now need to draw a graph of these array values in Crystal, but I can't seem to do this when I try to construct a chart.
Thanks Rosemary. I am running Crystal V9. I need to calculate a 12 month rolling figure (i.e. the sum of the previous 12 months' numbers). I have done this using an array. I now need to graph these 12 month rolling figures to examine the trend for each month. But the formula I have used to calculate the arrays is not a field which can be "graphed" on. Hence my problem.
Ok ... are you stating that the array contains the sum of some column/data, one element in the array representing each month?
If so, then I would create 12 separate formulas. For example, 01_Mo, 02_Mo and so on. Now the sum of these formulas can be used in a chart to do exactly what you state.
Here is an example from one of my reports, where I have done a "manual crosstab". I generate the column header in one formula and then in another and check the date of my record to see if it in the range of that month and print a 1 or 0... you could change the then 1 else 0 part to then {table.Column} holding the value for that month.
The nice thing about this is that I can group my report by whatever I want and get grandtotals for the month and summaries at each group level.
I can also chart on the data.
Here is the formula for the column header:
dateadd("m", -12,{?Pm-@ReferenceDate})
I just place that on my report and format it to show Month only.
Next, is 01_Mo formula and represents the month that is 12 months from the reference date parameter (I prompt user for "Run As" date).
if {Incident.Open Date & Time}
in
CDATE(
Year(dateadd("m", -12,{?Pm-@ReferenceDate})),
Month(dateadd("m", -12,{?Pm-@ReferenceDate})),01)
to
cdate(
dateadd("M",-11,cdate(year({?Pm-@ReferenceDate}),month({?Pm-@ReferenceDate}),1))-1
)
then 1
else 0
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.