Finding the first working day of the month

RitaD
edited November 2022 in Modeling

Hi guys,

 

I am trying to create a calendar. In this calendar I need to pull out the first working day after day X.

For example : I have a module with holidays, working days etc. as booleans and on the other side I have 1st of january 2nd etc.

Let's imagine the 1st of jan is a saturday. I would like then to check the 2nd of jan which is sunday (off day again) and then the 3rd which is a monday and not an off day. That way I would have my line item showing 3rd january 2022

I'm having trouble figuring out how to do so, thank you for you help.

Not sure if everything's clear don't hesitate to ask me if needed.

Thanks

Best Answer

Answers

  • ManjunathKN
    edited November 2022

    Hi @RitaD ,

    Let me know if below solution works.
    Grid view

    ManjunathKN_0-1669034645897.png

    BP view

    ManjunathKN_1-1669034686168.png

     

    Thanks,
    Manjunath

  • RitaD
    edited November 2022

    Hi @ManjunathKN,

     

    Thank you for your answer. So basically what you have there is what I have on my model.

    Now I need to get the "first working day of january" for example (which should give me the 3rd).

    My first thought was using a loop that would check for the 1st if "working dates" is empty or not, if it is then check the next day etc. but I don't think there are loops on anaplan right ?

    My second thought was to create a view where we would only see the not empty "working dates" then work on it but I don't think formulas take in consideration specific views.

    I'm trying to think of something else, since I'm a beginner I might not've thought about all the possible ways.

     

    Thanks !

  • ManjunathKN
    edited November 2022

    @RitaD ,

    I am bit lost, did it solve or you are seeing for something else?

    Thanks,
    Manjunath

  • RitaD
    edited November 2022

    @ManjunathKN 

    Oh sorry, no it is not solved. What you created is what I had in the beginning.

    I couldn't figure out how to get the first working day of the month with these datas

  • ManjunathKN
    edited November 2022

    @RitaD 

    okay, you mean that, lets say in Jan 21 month if first working day is friday I should get that date and in feb 21 if my first work day is 3rd feb then i should get only that date right?

    Thanks

  • RitaD
    edited November 2022

    @ManjunathKN 

    Exactly (the first working day in feb21 is the 1st because it is a monday) but yeah that's what I'm trying to do

  • RitaD
    edited November 2022

    @ManjunathKN 

    Exactly ! 

    Thank you very much.

     

    Last thing, I couldn't manage to reproduce it. Is my time range not right ? 

    Did I forget something ? 

    screenshot.png

    BP view

     

    bp view.png

     

     

     

  • ManjunathKN
    edited November 2022

    @RitaD ,

    I cannot read your Screenshot, its blurry

     

  • RitaD
    edited November 2022

    @ManjunathKN 

     

    Try in the attached files to download.

    My month field is January in december and also in january and my "first working date" is the 27th of december 21 the whole january month (in the past).

     

    Thank you

  • ManjunathKN
    edited November 2022

    @RitaD ,

    You dont have months as summary but you have weeks. you are still getting correct values for months but if you want to have only for weeks like your screenshot than change month line item and format of that.

    ManjunathKN_0-1669043696864.png

    That should be weeks not month for your case.

    Thanks,
    Manjunath

     

  • RitaD
    edited November 2022

    @ManjunathKN 

    Oh alright, I switched to months just to try it out. Still the same issue. The whole month has the same "first working date" which is kinda logical. That is why I don't understand how you got the perfect result !
    Your help is really useful thank you. 

    (same screenshot attached)

    screenshot2.png

  • RitaD
    edited November 2022

    @ManjunathKN,

     

    I wasn't able to reproduce it but I'll put the subject as solved since you obtained the wanted result.

    Thanks

  • ManjunathKN
    edited November 2022

    Hi @RitaD,

    Personally I wont provide solutions to mark a comment solved. I am not sure why you could not reproduce it, I have few questions here 1.what is the Timescale of your model, 2. What is the time range for that module(if you are using time range for that module).

    Let me see, how I can help you.

    Edit: 3. what is the summary included.

    ManjunathKN_0-1669126770625.png

     


    Thanks,
    Manjunath

  • RitaD
    edited November 2022

    Hi @ManjunathKN,

     

    Glad to hear that !

    1. In case the screenshot is blurry : My time scale is Month/quarters/years, it starts on january 2022 with 2 future years and the current period is Jan 22

    RitaD_0-1669201862430.png

    2. The time range for that module is the model calendar and the time scale is day

    3. I don't have any box checked. I tried the same as yours without success.

     

    Thanks

     

  • Useful workaround.