Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi,
how can i add a variable like "month(today())" to month in below set analysis. thanks
Sum({<year={2013},month={May},day={2}>}TRA_QTY)
 its_anandrjs
		
			its_anandrjs
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try like
Let currentMonth = Num( month(today()) ); //If Month field has numeric values then put Num in the expression other wise you can use same currentMonth = month(today())
Sum({<year={2013},month={' $ (currentMonth ) '},day={2}>}TRA_QTY)
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		$(=Month(Today())-1 ) -> would only work if the month field contain numeric values.. Otherwise, try with addmonths(), like Sum({<year={2013},month={' $ (=Month(AddMonths(Today(),-1 ))) '},day={2}>}TRA_QTY)
 
					
				
		
hi Ashfaq,
month should return like May not '5' and also single quotations mustn't be there.{ }. How can i do that?
 
					
				
		
Hi tresesco,
it s not working when there are single quotations inside of the brackets. is there any method without single quotations?
 its_anandrjs
		
			its_anandrjs
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Put Num in the expression
In your Load statement add new field Num(Month) as NumMonth and use it in the expression but if it is in num then try
Sum({<year={2013},month={' $ (=Num(Month(Today())) ) '},day={2}>}TRA_QTY)
 MK_QSL
		
			MK_QSL
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Sum({<year={2013},month={'$(=SubField('$(MonthNames)', ';',Month(Today())-1))'},day={2}>}TRA_QTY)
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If your month field values like- Jan, Feb, ... It should work with single quotes/double quotes. You could post a sample qvw so that we can find the actual issue.
 
					
				
		
Sum({<year={2013},month={ '$ (=Month(AddMonths(Today(),-1 )))' }, day={2}>}TRA_QTY)
i tried like this. but it returns value 0. but when i wrote it like this
Sum({<year={2013},month={May}, day={2}>}TRA_QTY)
it s returning values correctly. what is wrong here?
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		If you put single quotes directly like: =Sum({<year={2013},month={'May'}, day={2}>}TRA_QTY) Do you get the same value?
 MK_QSL
		
			MK_QSL
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Check my reply
