creating and using two dimensional arrays

I am hoping I can get an example of creating and populating two dimensional array in Dundas script. I have tried various versions of code below and cannot get it to work. Hopefully someone can point me in the right direction.

var 2dArray =

{ {"item0a","item0b"},

{"item1a","item1b"},

{"item2a","item2b"} }

for (int i = 0; i < 2dArray.Length / 2; i++)

{

var vps = viewParameters.filter(function(vp) {

return vp.name == 2sArray[i,0];

})[0];

var paramValue = vps.parameterValue.value;

var columnName = 2dArray[i,1];

. . .

}

sorry,

The following elements are not supported in DundasScript:

  • Multidimensional arrays.

https://www.dundas.com/Support/learning/documentation/data-metrics/writing-data-scripts-with-dundasscript


try:

https://www.dundas.com/Support/learning/documentation/data-metrics/transforms/other/r-data-generator

or if version 5

https://www.dundas.com/support/learning/documentation/data-metrics/transforms/other/python-data-generator


ps, now i just forgot what i was going to look up on the suport site, wait ..... oh yea i remeber now.

Good news, thanks to the great and creative folks at Dundas, they came up with the correct syntax, below is the correct format. Notice the use of square brackets [ ]


var 2dArray =

[ ["item0a","item0b"],

["item1a","item1b"],

["item2a","item2b"] ]

for (int i = 0; i < 2dArray.length; i++)

{

var vps = viewParameters.filter(function(vp) {

return vp.name == 2sArray[i][0]; //this would be "item0a"

})[0];

var paramValue = vps.parameterValue.value;

var columnName = 2dArray[i][1]; //this is "item0b"

. . .

}