Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting Previous Year as text


Hi,

I am selecting a month (ex- Sep 13) from list box. I have text box where in I want to display Oct 12 as output.

Any idea how to do that.

I tried with the following

 

=

date(num(Month-365),'MMM-YY')

But, it doesnt work. It throws Sep 12. Here Month is a field in table having values like May 13, June 13 etc..

1 Solution

Accepted Solutions
PrashantSangle

Hi,

If you want output in MMM YY format

Then write

Date(AddMonths(Date#(YourField,'MMM YY'),-11),'MMM YY')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

4 Replies
PrashantSangle

Hi,

Try this

AddMonths(Date#(YourField,'MMM YY'),-11)

or

use AddYears(Date#(YourField,'MMM YY'),-1)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

Hi,

If you want output in MMM YY format

Then write

Date(AddMonths(Date#(YourField,'MMM YY'),-11),'MMM YY')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Thanks mate..it works..

jyothish8807
Master II
Master II

Hi Vimal;

Try:

=Date(Addmonths(date#([Your field]),-11),'MMM YY')

Regards

KC

Best Regards,
KC