Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bharatkishore
Creator III
Creator III

Need last Year

Hello All,

I have a month field where the data is like May-16,Jun-16.

Now my requirement is i need to get last year. For example when i select May-16 i should get May-15.

I have given max(month)-12 but it is converting to integer..like 42479..Can you please help me on this..

Thanks,

Bharat

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

12 Replies
antoniotiman
Master III
Master III

Hi,

Try

MonthName(AddMonths(Max(Month),-12))

Regards,

Antonio

Anonymous
Not applicable

you can use if month is a datefield like May-16 and not only May

addyears(max(month),-1)

bharatkishore
Creator III
Creator III
Author

Thanks Antonio for the reply..

I have given the following condition and in vlastyear i have given the following condition =MonthName(AddMonths(Max(S5_Month2),-12))

=sum(if(S5_Month2=vLastYear,S5_Leads))..

But i am getting the values are 0.

agomes1971
Specialist II
Specialist II

Hi,

please see this

Current Month v. Same Month Last Year

HTH

André Gomes

antoniotiman
Master III
Master III

Try

Sum({<S5_Month2={'$(=vLastYear)'}>} S5_Leads)

bharatkishore
Creator III
Creator III
Author

I have tried but still the value is 0..

antoniotiman
Master III
Master III

Instead of

MonthName(AddMonths(Max(Month),-12))

try

Date(AddMonths(Max(Month),-12),'MMM-YY')

bharatkishore
Creator III
Creator III
Author

Please find the attached qvw...

When it is without selection it is coming but when i select any month the data is becoming 0..Kindly check..

Not applicable

Use this to get previous year same month

MonthEnd(max(DATEFIELD),-12)

for your requirement   like this   Date(MonthEnd(max(DATEFIELD),-12),'MMM-YY')