Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Dear All,
i'm looking for a way to define a variable in the script editor, outside of the load statement. To give some context info: in my current qv report, i load sales data from three different excel files;
for the field 'Date', i would like to define a variable called 'maxdate', calculating the most recent date of all my data, to immediately show the last day's numbers on my dashboard screen.
how would you do this?
thank you,
joris
 
					
				
		
 m_woolf
		
			m_woolf
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Create the variable in Variable Overview
Define the variable as:
=max(YourDateField)
 
					
				
		
 sushil353
		
			sushil353
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		use max(datefield)
 
					
				
		
 rajni_batra
		
			rajni_batra
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Load Only date field from all ur excels and concate them, then take resident of that and calculate max(date) as Date and then use peek function to store that into a variable.
Transactions:
LOAD 
     [Date] as [Posting Date]  
FROM
(qvd);
concatenate
LOAD 
     DATE as [Posting Date]     
FROM
(qvd);
Temp:
Load
               min([Posting Date]) as minDate,
               max([Posting Date]) as maxDate
Resident Transactions;
Let varMinDate = Num(Peek('minDate', 0, 'Temp'));
Let varMaxDate = Num(Peek('maxDate', 0, 'Temp'));
 
					
				
		
 m_woolf
		
			m_woolf
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Create the variable in Variable Overview
Define the variable as:
=max(YourDateField)
 
					
				
		
Thank you,
it works
