Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
------------------------------my script:
Fact_SKU_Price:
load distinct ID
,Brand&' '&Package as Product_Name
,Retail_Price as Retail_Price
resident SKU_Price_temp;
Dim_Product:
load distinct Product_Name as Product
resident Fact_SKU_Price;
FOR i = 0 TO NoOfRows('Product') - 1
LET vProduct = peek('Product', $(i));
LOAD ID
,Retail_Price as '$(vProduct ) '
RESIDENT SKU_Price
where Product = '$(vProduct )';
NEXT i
I want to Anti-Crosstable the price value of every product. In the debug, I saw the value of vProduct is correct in the first loop. But from begining of the second loop, the value of vProduct is always 'NULL'.
But if the FOR...NEXT is simply following,the value of vProduct is always correct in debug :
FOR i = 0 TO NoOfRows('Product') - 1
LET vProduct = peek('Product', $(i));
NEXT i
What's wrong with my script?
Hello, Jonh.
Why do you use NoOfRows() function for field?
You should use a fieldvaluecount('Product') or NoOfRows('Dim_Product')
Thanks for sparur, using fieldvaluecount('Product') is OK.