Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 rustyfishbones
		
			rustyfishbones
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi All,
I have following table
Transaction:
LOAD
warehouse,
DATE([date-added],'DD/MM/YYYY') AS Date
FROM
(qvd);
LET vMaxDateTime = Peek('Date',-1,'Transaction');
However the variable is not returning the correct date
It should be returning 29/05/2014 but it keeps returning 26/09/2013
Any ideas?
 
					
				
		
 m_woolf
		
			m_woolf
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		What makes you think the it should be returning 29/05/2014?
 
					
				
		
Zero denotes first record of the table.
-1 denotes last record of the table
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Were the dates sorted when stored in qvd? Are you looking for max date? If so, try like:
Load
Max([date added]) a Maxdate
From <>;
LET vMaxDateTime = Date(Peek('Date'));
 
					
				
		
 m_woolf
		
			m_woolf
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Why don't you display the records sorted by load order to verify the contents of the last record?
 
					
				
		
 marcus_sommer
		
			marcus_sommer
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If you looked for the max(Date) this could be an alternatively: “Fastest” Method to Read max(field) From a QVD | Qlikview Cookbook.
- Marcus
