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!

Create Line Chart from Calculated field, no grouping

Status
Not open for further replies.

johnhugh

Technical User
Mar 24, 2010
702
0
0
SG
Hi, I'm using Crystal reports 10.
I'm trying to show a trendline for stock values for the last 12 months.
In order to do that I have to calculate the stock value from the very beginning up until the month I need.
I can't group the report by month, because many previous years are involved and I only want to show the last 12 months.

The formula for my monthly stock value calculation is like below

IF {@InventoryYearMonth} <= ToText(DateAdd("m",-1,currentdate),"yyyyMM") THEN
{INVENTORY.TRANSACTIONCOST}
ELSE
0

I summarize these values and want to show them in a line chart.
I'm able to do a bar chart by adding all 12 calculated fields for every month under the 'Show Values' section in the chart expert.
In a line chart it won't actually create a line. I believe the resaon is that it does not recognise the 12 values as a series.

Would anyone know a way around this? In Excel I can just give it 12 values and it creates a line chart for me.
 
Put a subreport in the report footer, pass it the parameters for just the last twelve months. group by month, suppress everything, graph.
 
Thanks. Pass the parameters from the main report to the subreport and show the graph in the subreport is what you mean?
 
Hi.
I've been trying to get this to work for days now but don't think it works as you suggested.
I already have 12 different variables with the stock totals for the last 12 months.
But I can't link these fields to a month which I need for the grouping in the subreport.

I think I have to create some temporary table to make this work, just don't know how.
 
I actually seem to have somehting working now with running totals.
The chart however includes all previous years, not just the last 12 months.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top