Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 ajaykumar1
		
			ajaykumar1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Everyone,
I need some one help to get the below requirement.
I need to get the script start time(system time) and end time(system time), and the below format should store into QVD.Also i need to maintain the history of the Start time and End Time daily(i.e. It shoud not override the data)
| Task Name | StartTime | End Time | 
| Reload_Sales | 29/07/2015 11:20:20 AM | 29/07/2015 12:40:00 PM | 
I wrote the following script But am unable to get the Start and End time in same above format.
Start:
LOAD *, now() as Date
INLINE [
Task Name, Action
Reload_Sales, Start Time
] ;
Load A,
B,
C
FROM xxxx.qvd;
Start:
LOAD *, now() as Date
INLINE [
TAsk Name, Action
Reload_Sales, End Time
] ;
Store Start into time.qvd;
Please correct me where am wrong to get the start and end time in the above mentioned format.
More Thanks in advance,
Ajay
 
					
				
		
 jagan
		
			jagan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		HI,
Try like this
LET vStartTime = Now();
Data:
LOAD
*
FROM Data.csv;
LET vEndTime = Now();
ReloadDetails:
LOAD
'Data Table' AS ReloadTable,
'$(vStartTime)' AS StartTime,
'$(vEndTime)' AS EndTime
AutoGenerate (1);
LET vStartTime = Now();
Data1:
LOAD
*
FROM Data1.csv;
LET vEndTime = Now();
Concatenate(ReloadDetails):
LOAD
'Data1 Table' AS ReloadTable,
'$(vStartTime)' AS StartTime,
'$(vEndTime)' AS EndTime
AutoGenerate (1);
// Add new records to QVD
IF Alt(FileSize('c:\Somepath\ReloadDetails.qvd'), 0) > 0 THEN
Concatenate(ReloadDetails)
LOAD
*
FROM ReloadDetails.qvd (qvd);
ENDIF;
STORE ReloadDetails INTO ReloadDetails.qvd;
Hope this helps you.
Regards,
Jagan.
 
					
				
		
 marcus_sommer
		
			marcus_sommer
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I think you will find here all what you want: https://community.qlik.com/docs/DOC-7177#comment-20906
- Marcus
 ajaykumar1
		
			ajaykumar1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks Marcus.But i want to store the start time and end time in a qvd.So based on the qvd i will compare my day on day how much time qvds are taking to store.
I hope my requirement is clear.
More Thanks,
Ajay
 maxgro
		
			maxgro
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Start: load * from time.qvd (qvd);
LOAD *, Timestamp(now()) as Date
INLINE [
Task Name, Action
Reload_Sales, Start Time
] ;
Store Start into time.qvd;
// ............
LOAD *
FROM a11.qvd
(qvd);
Start:
LOAD *, Timestamp(now()) as Date
INLINE [
TAsk Name, Action
Reload_Sales, End Time
] ;
Start: load * from time.qvd (qvd);
LOAD *, date(now()) as Date
INLINE [
Task Name, Action
Reload_Sales, End Time
] ;
Store Start into time.qvd;
 ajaykumar1
		
			ajaykumar1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks Massimo.
The first line;
start: load * from time.qvd(qvd)?
From where i need to get this initially?
if possible plz add any sample qvw file.
Thanks,
Ajay
 maxgro
		
			maxgro
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		you have to check if the file exists
Re: check if qvd file already exist or not
if the file doesn't exist, skip the first load
 ajaykumar1
		
			ajaykumar1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Ok...I will check above script tomorrow and get back.
Thanks for your time.
Ajay
 
					
				
		
 marcus_sommer
		
			marcus_sommer
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If you looked through the post and all comments you will find a solution with various additionally informations about the last load to store in a qvd.
- Marcus.
 ajaykumar1
		
			ajaykumar1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks Massimo,
I have checked and executed your script, and getting following output.
| Job Name | Action | Date | 
| Reload_Sales | Start time | 7/29/2015 11:52:05 AM | 
| Reload_Sales | Start time | 7/29/2015 12:30:46 AM | 
| Reload_Sales | End time | 7/29/2015 12:52:05 PM | 
| Reload_Sales | End time | 7/29/2015 1:30:46 AM | 
But, I need output like below format in QVD.
| Job Name | Start time | End time | 
| Reload_Sales | 7/29/2015 11:52:05 AM | 7/29/2015 12:52:05 PM | 
| Reload_Sales | 7/29/2015 12:30:46 AM | 7/29/2015 1:30:46 AM | 
Thanks
Ajay
 ajaykumar1
		
			ajaykumar1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi All,
Any help from any one.
Thanks
Ajay
