I want to get the first month of a period set in module calender.




I want to automatically display the first month of a calendar set in a module that has not been applied to.

Can ido it?

Please help!

Best Answer

  • ManjunathKN

    Hi @KubotaNatsuki 

    Formula given above is correct. 
    I have break it down for you and highlighted the formula in yellow. 
    Module with time dimension


    Module without time dimension




  • @KubotaNatsuki 

    I have already answered how to get first month. Please check here.


    Short answer is: LAG(1,1,0) <> 0


    Best regards,


  • Thank for your reply!
    Sorry...I want to display it in a module with no time axis and no Apply To.
    So your method is a bit different.
    Do you know how to do it?
  • @KubotaNatsuki 

    Not sure i understood correctly. What means no Apply to?

    But you can try to create a list with a single element in it which will repersent the first month of the time scale.You will add it as a dimention of your module.

    And then using mapping to time period make a lookup to collect values from sources which have time scale.

    Otherwise, please share your idea with some more details.

  • Hi @KubotaNatsuki


    You can also do a timesum() will be able to retrieve the first nonblank item of a timescale. Only limit is that you can't do a timesum() directly across periods you have to convert a period to data and then back to period again: 



    First Period Line item has no Applies to, just a single line item. 



  • Nice trick, but it wouldn't allow to calculate last month as well. Is there a simple way to calculate both first and last time periods without need to create auxiliary items with timescale applied? 🙂

  • Hi @Kavadera 

    Please find the below way to find the last month.




    I am not sure if this is what you were asking.


  • Hi, @ManjunathKN


    What you've provided is last month for a year. What I try to get is the last period in the whole timescale. But when I try to get END() from TIME.All periods I get blank for some reason 😞


    The previos solution with TIMESUM worked great for first month, but I can't apply it to find the last one as well

  • Hi,

    I tried something for you, not sure it is best solution.

    you need to create a boolean check for checking the last period, you can also automate this with formula MAX(CUMULATE(1, FALSE), 1) > 59 (is total period in timescale -1) its still a hardcode, if i find anything i will let you know.



    Hope this is helpful,



  • Hi @Kavadera 




  • Haha, @ManjunathKN 


    Thanks for trying but I think CUMULATE is an overkill here 😄

    Guess, there's just no way you can possibly get that result without creating an auxiliary line item with time dimension. Yet another argument against using system timescale in Anaplan