Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey everyone,
In a chart, I calculate some fields with a selection in a set analysis telling I want the sum of the data only when MyMonth = Month(Today())-1 (So the previous month).
In the title of the column of the chart, I'd like to display the name of the month (Month(Today())-1 returns the number of the month)...
I would like to do something like Month(Today()-30), except that this won't work when we are on the 31st..
Any idea ?
Thank you for your help
=Month(AddMonths(today(),-1))
Use as below
=SubField('$(MonthNames)',';',Month(Today())-1)
=Month(AddMonths(today(),-1))
Use the text() function to force a text display (from the MonthNames script variable) or Date(Today(), 'MMM') for short names and Date(Today(), 'MMMM') for long names.
Replace Today() with AddMonths(Today(), -1) to get the previous month. Everything works both in expressions as well as in your load script.
Best,
Peter
one more. Date#() will read a month number as a month number using 'MM' . And then Date() with 'MMM' will output in month name format
= date(date#(Month(Today())-1,'MM'),'MMM')
or
= date(date#(Month(Today())-1,'MM'),'MMMM')