Showing results for 
Search instead for 
Did you mean: 

APO DP macro to test posting period

Former Member
0 Kudos

I am using APO DP v5.

In DP, I am using periods defined as posting periods, for example period number 001 of yeay 2007.

I need to check the posting period in DP macros. Which standard macro function could I use to test the value of the period, specifically the period number within the year and the year?


Bob Austin, Atos Origin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

to get the fiscal period in the year use -

"FISCAL_PERIOD(X) returns the number of the posting period specified by column X."

In order to get the Fiscal year in the column

"FISCAL_YEAR (X) returns the fiscal year of the period specified by column X."

if you just want the calendar year -

"YEAR( X ) returns the year of a date that is in whole numbers with reference to the date 0001/01/01. Example: For January 20th 1999 YEAR( DATE( 19990120 ) ) returns 1999"

Former Member
0 Kudos

Thanks for your reply.

I have a follow up question...

Suppose I have a planning book data view in calendar weeks. In my macro I want to test in which quarter of a year a week resides. How could I use the various DATE functions to achieve this?

Thanks, Bob.

Former Member
0 Kudos

You want the output as a quarter number?

you can extract weeks into a auxillary row from a macro

WEEK ( DATE ( "choose any cell in the same column "))

This will give the week number as output

Then you write a few more steps around the macro which says if week number = 1 to 13 then Quarter =1, if 14 to 26 quarter = 2 etc

Active Contributor
0 Kudos

You should be able to achieve this with a combination of functions such as YEAR(), BUCKET_EDATE() and FISCAL_PEIROD()

Answers (0)