argument #2 of 'GridValueAt' is out of range

I am getting this error in my crosstab.

argument #2 of 'GridValueAt' is out of range

The crosstab is comparing pounds sold for an item in the years 2014 and 2013.  looks like this


STORE #1     2013            2014
800JJ                3                  4
801qq             5                  6


STORE #2     2013
800FF               4

I guess the problem lies in there are no sales in 2014 for item 800FF, so no header for 2014, how would I fix that?
TomBallaAsked:
Who is Participating?
 
mlmccConnect With a Mentor Commented:
Try a formula like

If GetColumnPathIndexOf(2014) <> -1 AND  GetColumnPathIndexOf(2013) <> -1 then
    GridValueAt (CurrentRowIndex, GetColumnPathIndexOf(2014), CurrentSummaryIndex ) - GridValueAt (CurrentRowIndex, GetColumnPathIndexOf(2013), CurrentSummaryIndex ) 
Else if  GetColumnPathIndexOf(2013) <> -1 then
     GridValueAt (CurrentRowIndex, GetColumnPathIndexOf(2013), CurrentSummaryIndex )
Else
     GridValueAt (CurrentRowIndex, GetColumnPathIndexOf(2014), CurrentSummaryIndex )

Open in new window


mlmcc
0
 
mlmccCommented:
That would cause the error.

Not sure how to solve that.  Will have experiment with the crosstab and some data like you have.

mlmcc
0
 
mlmccCommented:
Where do you use the formula?

What formula are you using?

mlmcc
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
TomBallaAuthor Commented:
i have a formula called dates that gets the date range.
I have a formula called Year which separates the dates into their respective years.

I am using the calculated member to get the difference between 2014 and 2013, and that is when I am getting the error.
0
 
mlmccCommented:
The formula is used in the crosstab?

I don't have CR2008 on my machines at home.  I will check it out at work

mlmcc
0
 
TomBallaAuthor Commented:
Yes, this is in a crosstab.
0
 
TomBallaAuthor Commented:
Alright, that looks like it works.  Had to add quote marks around 2014 and 2013 but it looks to work.  
Thanks.
0
 
mlmccCommented:
In my report they years were numbers so no " ".  If yours are strings then the " " are needed.

mlmcc
0
All Courses

From novice to tech pro — start learning today.