Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 patrou38
		
			patrou38
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hello,
I have a table in which there are a quantity of equipment by week (February weeks in my example).
in another table I would like to have the sum of qty by month. I don't find the expression, the aggr ????
I expect that I'm enough clear.
than you for your help.
Patrick
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Oh... I see that you are doing a Distinct count... I am not sure why you need a DISTINCT... but if you need that... may be try this
Sum({<Facility = {'$(vFacility)'}, ModelFamily = {'$(vModelFamily)'}>} Aggr(Sum(DISTINCT {<Facility = {'$(vFacility)'}, ModelFamily = {'$(vModelFamily)'}>} [TC inventory]), Year_Week, Year_month))
 
					
				
		
 dapostolopoylos
		
			dapostolopoylos
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If there is a Month filed in the Data Model all you have to do is to bring it in your chart instead of Year-Week field...
If you don't have a Month field i suggest you to create it...
 patrou38
		
			patrou38
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hello, I tried without success as you can see below  
 
					
				
		
 dapostolopoylos
		
			dapostolopoylos
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You must have done something wrong with your date fields...
Can you share your script or at least the part where you create your date fields?
 patrou38
		
			patrou38
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		ciao Dimitrios,
below my script.
thank you very much for your help.
I had in mind that the problem coming from my script 
 
					
				
		
 dapostolopoylos
		
			dapostolopoylos
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		What i want you to show me is how you create the Calendar fields and most of all the Work_Week field which is your key
 patrou38
		
			patrou38
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		ok.
the calendar is defined in an excel file like this:
 
					
				
		
 dapostolopoylos
		
			dapostolopoylos
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Your calendar seems to be allright...
Did you use the Sum() function when yoyu tried to replace Year_Week with Year_Month in your chart?
 patrou38
		
			patrou38
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I'm using the same expression for the both .. .either for week or for month ....
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Would you be able to share your Excel file by attaching it here
