Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
So I'm trying to get a variable of average worked days.
The formula I'm currently using in the pivot tables is Cycle3_stop - Cycle1_start - Count({<nome = {'Attività non lavorative'}>} distinct assign_date) and it works. 
I've tried to set that variable with Avg(Aggr(Count({<nome = {'Attività non lavorative'}>} distinct assign_date))) but I get an error in expression.
Any ideas what might be wrong or how can I calculate the average in a variable with a better expression?
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be just this?
Avg({<nome = {'Attività non lavorative'}>} distinct assign_date)
Or, you have to put a dimension with aggr() against which you want the aggregation to work, like:
Avg(Aggr(Count({<nome = {'Attività non lavorative'}>} distinct assign_date) , YourDimension))
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be just this?
Avg({<nome = {'Attività non lavorative'}>} distinct assign_date)
Or, you have to put a dimension with aggr() against which you want the aggregation to work, like:
Avg(Aggr(Count({<nome = {'Attività non lavorative'}>} distinct assign_date) , YourDimension))
 
					
				
		
 devarasu07
		
			devarasu07
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
you can try like below,
count(aggr(avg({$<nome = {'Attività non lavorative'}>} distinct assign_date),Dimension1, Dimension2))
p.s: remember to update dimension 1 & 2
also check this article,
If still not working share your mock data and expected output. tks
 
					
				
		
Thanks, I forgot to add the dimension on which I need the aggregation to work
