Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 TomBond77
		
			TomBond77
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi experts
I have this formula to calculate one month after January, in our case: 01.02.2023 - 28.02.2023
{<[YearMonth]={"$(='>=' & yearstart(MonthStart(Addmonths(max(YearMonth),+1))) & '<=' & MonthEnd(yearstart(Max(YearMonth), +1)))"}>}
It is not showing the right month. Where is the error.
Thanks for your help!
 ckarras22
		
			ckarras22
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hello
Could you please use the below
{<[YearMonth]={">=$(=yearstart(MonthStart(Addmonths(max(YearMonth),+1))))<=$(=MonthEnd(yearstart(Max(YearMonth), +1)))"}>}
 Parthiban
		
			Parthiban
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try This one...
One month after January Start = Date(YearStart(Today(),0,2),'DD/MM/YYYY')
One month after January End = Date(MonthEnd(YearStart(today(),0,2)),'DD/MM/YYYY')
Instead of Today, use YearMonth field.
Check this formula in your case. If this is not working let we check any other possibilities.
 Selvapriya_Thev
		
			Selvapriya_Thev@TomBond77 Hi
Kindly try this
{<[YearMonth]={">=$(=yearstart(MonthStart(Addmonths(max([YearMonth]),+1)))<=$(=MonthEnd(yearstart(Max([YearMonth]),+1))))"}>}
 Ahidhar
		
			Ahidhar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Would be better to write it with some aggregate function
 panosalexand
		
			panosalexand
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi, may I ask you to clarify? Would you like when you select January the calculation will be one month after?
 Ahidhar
		
			Ahidhar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Yes , we get values for next month . Take below table for example
try this in front end and we will get values for next month
Sum({<Yearmonth={"$(=monthname(Yearmonth,1))"}>}Value)
tab:
load *,
monthname(Date) as Yearmonth;
load * Inline
[Grp,Date,Value
Fed,02/1/2023,1000
Zed,14/01/2023,2000
Fed,27/01/2023,15000
Fed,02/02/2023,3000
Fed,04/02/2023,3500
Zed,15/02/2023,1200
Fed,03/03/2023,1523
Zed,13/03/2023,5000
];
 panosalexand
		
			panosalexand
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I have done something similar for one of my projects. But in my case, it was in the back end.
So this is what I did:
rename table XXXX to DataTemp;
Data:
Load *;
For i=0 to 1
Load Distinct Months ,
AddMonths(MonthStart(Months), $(i))+1 as PlusOneMonth,
Resident DataTemp;
Next i;
rename table Data to XXXX ;
