Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
t1:
Load Week,
Material,
[Weekly Material Stock] as Stock1,
[Weekly Material Demand] as Demand1
Resident Temp_Table
where WOCHE = $(vFieldValue_1)
;
Let Stock = Previous('Stock1');
Trace $(Stock);
I wanted to see what values Stock takes in my loop
I see only stock1 in the trace but not the values it is taking. Anyidea how to change my trace so that I can see the values it is taking??
Regards
Sravan
previous() references the field and values in the input table, which means that it can't be used outside of a load statement.
I would suggest that you use peek() instead.
To get the last record read:
LET Stock = peek('Stock1', -1, 't1');
Hi Steffan,
with Peek also it does not work
see here in this thread
http://community.qlik.com/forums/t/44670.aspx
Thanks
Sravan
It was quite a lengthy thread 🙂
However, I couldn't see that you had tested the exact same syntax that I suggested.
I saw the following row, but you are not defining the table as a string (with single quotation marks):
Let Stock = Peek('Stock1',-1,t1);
Try my suggestion in the example above and let me know if this works.
Kind regards
HI Steffan,
Thanks and sorry for confusing. I edited the Script in the other thread and yes as in the example which I have attached in the other thread, I used the same syntax which you wrote here. The problem is that peek and concatenate somehow seems not to work. I described extensively my problem in other thread.
Thanks anyway for your help.
Regards
Sravan
Hello Sravan,
I may have got you wrong, but if you want a list of possible values for field "Stock", once the whole table has been loaded, you can do as follows:
AllStockValues:LOAD CONCAT(DISTINCT Stock, ',') AS ValuesForStockRESIDENT t1;
If you mean you are within a loop and you want to know the last loaded value of "Stock", just do
LET vLastStockValue = Peek('Stock'); // No need for additional parameters
Hope that helps
Hi Miguel,
I dont get you. I am attaching the Example and I explained my problem in the application. can you please help?
[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Components.UserFiles/00.00.00.49.52/StockReporting.qvw]
Thanks
sravan
Any Ideas profis Here:)
Hi,
As the week changed I tried to change the present .qvw and upload. somehow it does not change Here is the new one.
[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Components.UserFiles/00.00.00.49.52/StockReportingLatest.qvw]
Regards
Sravan