🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Automator Export Naming - Need Next months month number

User: "Melissa_21551"
New Altair Community Member
Updated by Melissa_21551

I have an automator export that I need to include a month in the naming of the xlsx export.  I currently have the export name as "Monthly PMI.&[mm].&[yy].xlsx"

 

So if it runs today the name would be Monthly PMI.06.17.xlsx

 

What I need is for the date in the name to include next month not the current month.  so: Monthly PMI.07.17.xlsx

 

Is there a macro I can use to achieve this?

 

 

Melissa Falardeau

Find more posts tagged with

Sort by:
1 - 8 of 81
    User: "Altair Forum User"
    Altair Employee
    Updated by Altair Forum User

    Try "Monthly PMI.&[mm.+m.&[yy.+m].xlsx"

    To adjust by day use d, month m, year y but make sure you do it for each part of the date or you may have the prior year for example. you can do + or - for what you need.

     

    Let me know if that works.

    User: "Altair Forum User"
    Altair Employee
    Updated by Altair Forum User

    Try "Monthly PMI.&[mm.+m.&[yy.+m].xlsx"

    To adjust by day use d, month m, year y but make sure you do it for each part of the date or you may have the prior year for example. you can do + or - for what you need.

     

    Let me know if that works.

    Monthly PMI.&[mm.+1m].&[yy].xlsx

     

    This was an enhancement in v14.x to include Offset Expressions in Macros.  If you are on an earlier version then the above suggestions will not work.

    User: "Altair Forum User"
    Altair Employee
    Updated by Altair Forum User

    Monthly PMI.&[mm.+1m].&[yy].xlsx

     

    This was an enhancement in v14.x to include Offset Expressions in Macros.  If you are on an earlier version then the above suggestions will not work.

    Thank you Chris!  This worked!

    User: "Altair Forum User"
    Altair Employee
    Updated by Altair Forum User

    Try "Monthly PMI.&[mm.+m.&[yy.+m].xlsx"

    To adjust by day use d, month m, year y but make sure you do it for each part of the date or you may have the prior year for example. you can do + or - for what you need.

     

    Let me know if that works.

    Thank you!  Will this work for December - to roll the month and year?

    User: "Altair Forum User"
    Altair Employee
    Updated by Altair Forum User

    Thank you Chris!  This worked!

    All credit goes to Patrick for reminding me about the offsets.  I just added some extra detail.

    User: "Altair Forum User"
    Altair Employee
    Updated by Altair Forum User

    Thank you!  Will this work for December - to roll the month and year?

    The offsets only work on the individual macro itself and not the entire string.  I did some testing to generate a report with today's date &[yyyy]&[mm]&[dd] and then again with today's date +7 months &[yyyy]&[mm.+7m]&[dd] .  The results showed:

    Today's date: 20170622.xlsx

    Today+7 months: 20170122.xlsx

     

    Basically the month did rollover to January, but did not increase the year.

    User: "Altair Forum User"
    Altair Employee
    Updated by Altair Forum User

    The offsets only work on the individual macro itself and not the entire string.  I did some testing to generate a report with today's date &[yyyy]&[mm]&[dd] and then again with today's date +7 months &[yyyy]&[mm.+7m]&[dd] .  The results showed:

    Today's date: 20170622.xlsx

    Today+7 months: 20170122.xlsx

     

    Basically the month did rollover to January, but did not increase the year.

    if you add the .+7m to the year, &[yyyy.+7m] it will give the year for 7 months from now. I didn't test this but when I do &[mm.-d]&[dd.-d]&[yy.-d] it has always given me the correct date for yesterday.

     

    good thinking about the different versions, I didn't realize that this was the first version with it.

    User: "Altair Forum User"
    Altair Employee
    Updated by Altair Forum User

    if you add the .+7m to the year, &[yyyy.+7m] it will give the year for 7 months from now. I didn't test this but when I do &[mm.-d]&[dd.-d]&[yy.-d] it has always given me the correct date for yesterday.

     

    good thinking about the different versions, I didn't realize that this was the first version with it.

    Patrick,

     

    Thank you very much.  This worked!!