Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

MonthName(AddMonths...)

Hello,

I have a problem with addmonth.

i write =monthname(AddMonths(AnnéeMois,-1)) but it's not working.

any help please

15 Replies
sunny_talwar

When you say its not working, can you elaborate what the issue is? Does it give you an error, or does it become null? What exactly is the issue?

On another note, have you made sure AnnéeMois is a date field and not text field formatted as date?

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

If this works than the issues with the date formatting:

=MonthName(AddMonths(today(),-1))

Could you please let us know how your date field looks like and what kind of values do contain?

Not applicable
Author

Hi Sunny,

it become null

sunny_talwar

My guess is that AnnéeMois is not read as a date. Can you try this:

=MonthName(AddMonths(Date#(AnnéeMois, 'DateFieldFormatHere'), -1))

Where you will replace DateFieldFormatHere with the format that is associated with AnnéeMois

Not applicable
Author

it's not working

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Share with us how your AnnéeMois field looks like.

Not applicable
Author

I think the problem is qlikview not read AnnéeMois like a date but i dont know how and what i can to do for to change this

Not applicable
Author

AnnéeMois is like Juillet 2015

bertinabel
Creator
Creator

Hola Sami,

     ¿Ya probaste con la solución que te indicó Sunny T?

=MonthName(AddMonths(Date#('Jul 2015','MMM YYYY'),-1))

en u caso es reemplazar 'Jul 2015' por AnnéeMois

=MonthName(AddMonths(Date#(AnnéeMois,'MMMM YYYY'),-1))