Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to use ADDMONTHS() but as per my knowledge it needs a proper date as input. I have the month and year as separate variables.
How to implement the function??
Something like below..
=AddMonths(MakeDate(Year(Today()),Month(Today()),1),1)
Hi,
As Manish Said You have to first Make Date Using MakeDate()
Then use AddMonth(DateField,1)
Like,
MakeDate(Year,Month,01) as NewDate,
AddMonths(NewDate,1) as NextMonth
Regards,
Hi,
Ex:
Year : 2014
Month : Mar
MonthNum : 3 or 12 (If normal/Finance)
MakeDate:
=Date(MakeDate('2014','3'),'DD/MM/YYYY')
AddMonths:
=Date(AddMonths(Date(MakeDate('2014','3'),'DD/MM/YYYY'),2),'DD/MM/YYYY')
Thanks for replying... but sorry it dint work
What if I have year and month selected by user? I cant hardcode like 2014 and 3.
Replace those static data with your Year and MonthNum fields
Note: When user selects any month the corresponding moonthnum we can get
I tried it, but no use.
Actually I am using the maxstring function to fetch month from user. So I created monthnumber in a variable using
NUM(Month(MaxString({[new]} [Month])))
where new is my alternate state.
Then I used this variable in the expression given by you in place of 3, but no output.
As you said that you have variables for month and year
means your data contains Month and Year fields.Corresponding that Month,Create a MonthNum field by using applymap/Join
Ex:
MapTable:
Mapping Load * Inline [
Month, MonthNum
Apr, 1
May, 2
Jun, 3
Jul, 4
Aug, 5
Sep, 6
Oct, 7
Nov, 8
Dec, 9
Jan, 10
Feb, 11,
Mar, 12
];
YourDataTable:
Load *,
ApplyMap('MapTable',Month) as MonthNum
From ********;
After that create variables as i said and it will work
Thanx