Hi Friends
I need a simple calculation. The idea is to go to the previous month. CurrMonth returns 8 (August) I want PrevMonth to be 7 (July)
Direct minus is not working. Any suggestion?
Solved! Go to Solution.
@Kallis Alteryx has a DateTimeAdd function that you can use to add/subtract from any part of the date depending on how you format it.
Bacon
@Kallis Update the formula to the below formula.
What I did was pull the month value from the newly created July date.
Bacon
DateTimeMonth(DateTimeAdd([date],-1,'month'))
@Kallis You are doing it on the wrong field, because CurrMonth is an Integer, not a date, it's not working. Do you PrevMonth calc using a date field, in this case the DateTimeNow() field.
Bacon
DateTimeMonth(DateTimeAdd(DateTimeNow(),-1,'month'))
Thanks @abacon
It works now.