Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Here is a snippet of a script that I am working on:
DataRaw:
LOAD * Inline [
path, path_count
'String1',2
'String2',1
'String3',1
'String4',2
'String5',1
'String6',1
];
Let numRows = NoOfRows('DataRaw');
For myRow = 1 to NoOfRows('DataRaw')
Let vFld = FieldValue('path',myRow);
Let vCount = FieldValue('path_count',myRow);
Let myPlace = 1;
Next myRow
The first two rows of the data process just fine but I am getting Null for the value of vCount at the third row and every row after that. Here is my debug output.
What am I doing wrong?
I got the same result. What about using Peek? I had better luck with Peek.
DataRaw:
LOAD * Inline [
path, path_count
'String1',2
'String2',1
'String3',1
'String4',2
'String5',1
'String6',1
];
Let numRows = NoOfRows('DataRaw');
For myRow = 0 to (NoOfRows('DataRaw')-1)
Let vFld = Peek('path', myRow, 'DataRaw');
// Let vFld = FieldValue('path',myRow);
Let vCount = Peek('path_count', myRow, 'DataRaw');
// Let vCount = FieldValue('path_count',myRow);
Let myPlace = 1;
Next myRow
I got the same result. What about using Peek? I had better luck with Peek.
DataRaw:
LOAD * Inline [
path, path_count
'String1',2
'String2',1
'String3',1
'String4',2
'String5',1
'String6',1
];
Let numRows = NoOfRows('DataRaw');
For myRow = 0 to (NoOfRows('DataRaw')-1)
Let vFld = Peek('path', myRow, 'DataRaw');
// Let vFld = FieldValue('path',myRow);
Let vCount = Peek('path_count', myRow, 'DataRaw');
// Let vCount = FieldValue('path_count',myRow);
Let myPlace = 1;
Next myRow
Well after much hair pulling the solution seemed to be to use the Peek function instead of FieldValue and also specify the table name. Additionally the first record for use with Peek is record 0.
So the script should look like this...
For myRow = 0 to NoOfRows('DataRaw')-1
Let vFld = Peek('path',myRow,'DataRaw');
Let vCount = Peek('path_count',myRow,'DataRaw');
Let myPlace = 1;
Next myRow
We were typing at the same time. I'll mark yours as correct.