Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
See the below code:
DistinctLotNo:
LOAD Distinct LotNo as DistLotNo
FROM
Table1
(qvd);
for k =0 to (NoOfRows('DistinctLotNo')-1)
Let data = Peek('DistLotNo',$(k));
LOAD LotNo,A,B,C,D
FROM
Table1.qvd(qvd)
Where LotNo = '$(data)';
NEXT k
- Here the peek function is not working properly. What i'm saying is for 1st iteration data variable can able to hold the value but in 2nd second iteration the data variable shows the NULL value.
Take the variable $ and brackets away from your 'k' reference. Eg: 'Let data = Peek('DistLotNo',k,'DistinctLotNo');
Hope that helps,
Matt - Visual Analytics Ltd
Take the variable $ and brackets away from your 'k' reference. Eg: 'Let data = Peek('DistLotNo',k,'DistinctLotNo');
Hope that helps,
Matt - Visual Analytics Ltd
Thanks for your help.. I don't know what i did now my code is executing perfectly.
I got problem again but when i use your code it is working perfectly.
I'm not sure if it's about the variable enclosing in $() or not, but I think it's definitely about using the third parameter to peek function given the table name - you'll need that outside a table load context, I believe.
Swuehl
I don't know where i'm doing wrong. Sometimes my code is working excellently but sometimes not. I'm using every time same data only there is now change in my data.
But if i use the code given by Matt.. It is working everytime for n no. of executions.
So you don't have a problem then
No seriously, I assume you are comparing your code with Matts.
As said, Matt has indicated the table name with third parameter, I believe that is making the difference. I'm not quite sure why yours seems to work from time to time, and I would have also used the dollar sign variable syntax like in your original code.
But for now, if Matts code is working just fine, you don't have a problem, do you?
Regards,
Stefan
If i use dollar sign in matt code i don't have any problem. Any way it's working fine thanks to share your knowledge also on this.