Error message examples
The «colIndex» parameter to ConcatRows cannot be omitted here. When the «colIndex» parameter is omitted, ConcatRows will default the parameter to an index introduced by an earlier call to ConcatRows or Concat, or to an implicit dimension. However, in this case the omitted parameter cannot be matched to any such dimension.
The second («rowIndex») and third («colIndex») parameters to ConcatRows specify which dimensions of the array (the first parameter) are being operated over. ConcatRows wants you to explicitly specify those whenever it is possible to do so. However, there are a couple of legitimate cases where may omit one or both of these index parameters. The function must still identify a rowIndex and a colIndex to operate over even when the parameters are omitted, but in certain cases when the parameters are legitimately omitted, it is clear which dimensions are implied. This error occurs because you are not in one of those legitimate cases, and it is not at all clear which index of the array is implied. To understand these legitimate cases better, we'll describe them.
The first case where the index parameter would be omitted is where you are nesting calls to ConcatRows, which is convenient when flattening over three (or more) dimensions. The following is an example:
Index I1 := 0..9; Index I2 := 0..9; Index I3 := 0..9; ConcatRows(ConcatRows(I1 & I2 & I3, I3, I2), I1)
Notice that the third parameter, «colIndex», is omitted in the outer call to ConcatRows. The inner call will return a 2-D result -- the
I1 index isn't operated over so it propagates through via array abstraction, and a new local index, named .ConcatIndex, is created by ConcatRows for the result dimension. It is very clear in this case that this new .ConcatIndex dimension is implied for the omitted «colIndex» parameter, so no error results. In the flattened result, the
I3 digit will vary fastest, and the
I1 digit varies slowest.
Similarly, we could omit the «rowIndex» parameter instead:
Index I1 := 0..9; Index I2 := 0..9; Index I3 := 0..9; ConcatRows(ConcatRows(I1 & I2 & I3, I3, I2), , I1)
Again, here it is clear that the .ConcatIndex dimension is implied for the «rowIndex» parameter. This call differs slightly in that here the
I1 digit now varies fastest and
I2 varies fastest.
One confusing case (but fairly rare) case that can cause this error is when both index parameters are omitted, and although there is a natural dimension to be implied for either parameter, there aren't two natural choices since they must be distinct indexes. This could occur here:
Index I1 := 0..9; Index I2 := 0..9; Index I3 := 0..9; ConcatRows(ConcatRows(I1 & I2 & I3, I1, I2))
Again, the inner ConcatRows returns a .ConcatIndex dimension, which could serve as «rowIndex», but since it can't simultaneously server as the «colIndex», the error will be issued complaining about the «colIndex».
The second case where it is legitimate to omit the index parameter is when you want to operate over the implicit dimension. Your array must, obviously, contain an implicit dimension for this to work.
If there is no .ConcatIndex and no implicit dimension in the first parameter, then the appropriate indexes for the omitted «rowIndex» and/or «colIndex» are not implied.
You might argue that if the array is 2-D, and one of the indexes is specified, it is obvious that the other index is implied. Although this is true, Analytica rejects that case here because it was not essential to omit the parameter, and in so doing you simply prevent your model from being array-abstractable. By forcing you to explicitly specify the index, Analytica is encouraging you to create abstractable models that will ultimately be more flexible.
Whenever possible, specify the two index parameters to ConcatRows explicitly. If the index are explicitly specified, this error won't occur.