Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi.
I enter the following terms for a line in a line chart: "=IF (Period > date(AddMonths(Today(), -13, 0), 'YYYYMM'), Period)"
I want to get out continuously for the last thirteen months. Unfortunately, all months in Period are returned. What am I doing wrong?
Regards
Jan
Is your Period field a date field or is it a numeric value of say, 202101?
The Date() function will return a date field. The 'YYYYMM' is simply the display formatting, so if Period is a numeric field, you are comparing a numeric to a date field.
Try this:
=if(YearMonth > Year(AddMonths(Today(),-13))&Num(Month(AddMonths(Today(),-13)),'00'), YearMonth)
If that returns the desired results, the Period data type is most likely the issue.
Is your Period field a date field or is it a numeric value of say, 202101?
The Date() function will return a date field. The 'YYYYMM' is simply the display formatting, so if Period is a numeric field, you are comparing a numeric to a date field.
Try this:
=if(YearMonth > Year(AddMonths(Today(),-13))&Num(Month(AddMonths(Today(),-13)),'00'), YearMonth)
If that returns the desired results, the Period data type is most likely the issue.
yes, Period is a numeric field.
your solution gave the desired result, thank you very much for the help.