Share ways to manipulating on "FinPeriod"

  • 18 August 2022
  • 4 replies
  • 187 views

Userlevel 6
Badge +5

Hello,

    Looks like we don't have parameters “@Period” like “@today”, which we can get Current Period or Last Period or any other period we like directly.
    But according to my recent expericence, we can manipulate period in some ways, and I have put the details in the below 2 post:

 

 

In short here:

  1. We can use datatime formula to get the current period like below:
    =iif(Month(Now())<10,CStr(Year(Now()))+'0'+CStr(Month(Now())),CStr(Year(Now()))+CStr(Month(Now())))
  2. We can also join 
    “PX.Objects.GL.FinPeriods.TableDefinition.FinPeriod”  to get periods we want.
  3. We can calculate based on “FinPeriodID” fields like below:
    The below is supposed to join a period with its pre Period
    =IIf( Right( [ItemCustSalesHist.FinPeriodID], 2)='01',CStr( ( Left( [ItemCustSalesHist.FinPeriodID], 4)-1))+'12', [ItemCustSalesHist.FinPeriodID]-1)

 


4 replies

Userlevel 7
Badge +4

@ray20 It depends on what you’re looking for I think, but there are HistoryByPeriod tables which can store the period data of Last Activity Period.

Additionally, for reports using Report.FormatPeriod(@StartPeriod) + ' to ' + Report.FormatPeriod(@EndPeriod), where @StartPeriod and @EndPeriod are defined as parameters for the report.

Did you end up finding a workaround that you were looking for?

Userlevel 6
Badge +5

@BenjaminCrisman 
Thank you for your sharing.  Yes, I could get what I want by


The below is supposed to join a period with its pre Period
=IIf( Right( [ItemCustSalesHist.FinPeriodID], 2)='01',CStr( ( Left( [ItemCustSalesHist.FinPeriodID], 4)-1))+'12', [ItemCustSalesHist.FinPeriodID]-1)

Userlevel 5
Badge

I find this works well for my GIs, assuming your financial periods are formatted as MM-YYYY.

=PadLeft( CSTR(Month(@Param_Date)) , 2, '0') + CSTR(Year(@Param_Date))

Userlevel 1

I’ve been using the following for converting Today() into [ARTran.FinPeriodID] (YYYYMM format). The company I work for has our Financial Calendar start in November and end in October. This is why it starts off by asking if the month is greater than 10. I’ve identified the values that would need to be changed in order for it to work with other months.

Iif(Month(Today())>10,Concat(Year(Today())*100+100,(Month(Today())-10)),Concat((Year(Today()))*100,(Month(Today())+2))

 

10 represents (Start Month - 1) In my example, it is November (Which is 11, so thus 11 - 1 = 10)
2 is just the remainder of 12 - the above number (12 - 10 = 2)

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved