Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 marksmunich
		
			marksmunich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		
I am calculating Min of start date and max of enddate and want to store the result in a field.
eg: max(enddate)-min(Startdate) as Result_date.
but ist returning the error.
my ultimate Goal is to calculate the average(Result_date) for several product categories.
Thanks
 
					
				
		
 giakoum
		
			giakoum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		check if QV regards enddate and startdate as date fields
 marksmunich
		
			marksmunich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		they are number fields, but ultimately i Need result in date Format or days
 
					
				
		
 giakoum
		
			giakoum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		then it should work. Do you have a sample app?
 marksmunich
		
			marksmunich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		This is my requirement
max(enddate)-min(Startdate) as Result_date
and AVG(Result_Date)
avg(max(enddate)-min(Startdate)) as Résult date
does it work or do you have any suggestions.
 
					
				
		
 giakoum
		
			giakoum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If you max(enddate)-min(Startdate) the result is not a date, it is a number showing the number of days between the startdate and enddate (provided that QV treats startdate and enddate as dates). Is that what you want to average? In any case, a sample app would help.
 
					
				
		
.png) JonnyPoole
		
			JonnyPoole
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Here is a simple sample:

 PrashantSangle
		
			PrashantSangle
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I am little confuse can you just tell us.
What is your expected output??
Regards
 
					
				
		
Firstly, are you doing this calculation in Script? If yes, use the Group By functions
 marksmunich
		
			marksmunich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I tried doing in the script, but it is failing. for example first i want to find the Result time which is Max (Startdate) - Min(Enddate)
which i want to store in the new field result field, but qv says Expression error.
second Thing is i want to find the average result for each product per day. avg(Resultday)
The first one I have achieved in the frontend using a TextBox, but the second one I am unable to get it.
