Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 sspawar88
		
			sspawar88
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I have B.date in num format. I have take it as date(B.date) in script.
then take Date(MonthStart(B.date), 'MMM-YYYY'') as MonthYear fied.
Data is like :
| B.date | Emp_Name | Salary | 
|---|---|---|
| 2018-02-02 | A | 100 | 
| 2017-12-05 | B | 552 | 
| 2017-08-05 | C | 555 | 
| 2017-06-03 | D | 236 | 
I have one pivot table in which dimension is Emp_Name and I want only last four month data of Salary as in expression sum(Salary)
How I Can write a expression?
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be this
Sum({<MonthYearField = {"$(='>=' & Date(MonthStart(Max(MonthYearField), -4), 'MMM-YYYY') & '<=' & Date(Max(MonthYearField), 'MMM-YYYY'))"}>}Salary)
 
					
				
		
 sspawar88
		
			sspawar88
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		How can I do it at dimension rather than expression
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be this
If(MonthYearField >= MonthStart(Max(TOTAL MonthYearField), -4) and MonthYearField <= Max(TOTAL MonthYearField), MonthYearField)
