Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Calculated Member in Cross-Tab Post Reply Post New Topic
Author Message
upndown4par
Newbie
Newbie


Joined: 21 Jul 2010
Online Status: Offline
Posts: 8
Quote upndown4par Replybullet Topic: Calculated Member in Cross-Tab
    Posted: 14 Dec 2012 at 8:08am
In a subreport, I have a chart and a cross-tab using the same query.  The query retrieves a rolling 12 months worth of data, which the chart shows.  The cross-tab only needs to show the last 2 months of data.  To accomplish that, I created 2 summarized fields:  one that shows the data for each month and one that sets the value to 0 for all but the last 2 months. 

The chart is showing the data as intended.  For the cross-tab, I want to add a Calculated Member after the 2nd month that shows the percentage variance between those 2 months.

I am able to create the Calculated Member using the Difference formula and the formula it uses is:
GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("201209"), CurrentSummaryIndex) - GridValueAt(CurrentRowIndex, GetColumnPathIndexOf("201208"), CurrentSummaryIndex)

Because the Calculated Member column was inserted between those 2 columns, I created a column after the last column and copied the formula from the Calculated Member into there and then removed the Calculated Member.

In this case, the report was run for September 2012 so it will only show 201209 and 201208.

If the report was being run for October, however, the column headers would be "201209" and "201210", which would mean that the formula would be incorrect.

Instead of using the column name of "201209",, I tried using this:
GridValueAt(CurrentRowIndex, CurrentColumnIndex -1, CurrentSummaryIndex).  Unfortunately, it's causing an out of range error.

Is there a simpler way to get the correct formula?  Preferably, one that works!  Tongue

Any ideas and/or suggestions would be greatly appreciated.

I am using Crystal Reports 2008, version 12.1.0.892.

Thanks in advance.

Ron


Edited by upndown4par - 14 Dec 2012 at 8:09am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.078 seconds.