Year format calculation seems wrong

Options
pflink
pflink Member, ALL USERS, Certified Model Builder Posts: 4 Occasional Contributor

Hi,

 

I came upon a strange outcome of a (very simple) calculation. For my model I need to know in which Year a certain calculation should give out put. (Current year, current year +1 etc.) So I tried to create a boolean which specifies in which year a certain period is. It however gave strange out come, as it seems to wrongfully calculate some of the years.

Outcome.PNG

Code.PNG

 

There are probably better ways of creating the boolean (I would like to hear suggestions), but the calculation should work. Or am I missing something?

 

Thanks.

 

Kind regards

 

Pim

  

Comments

  • pflink
    pflink Member, ALL USERS, Certified Model Builder Posts: 4 Occasional Contributor

    @rob_marshall 

     

    Thanks for your quick reply, you are right, the start dates are in the previous year (calender is week 4-4-5).

     

    pflink_0-1618130753208.png

    Is there an elegant way of solving this, so that the booleans reflect the correct time period?

     

    Kind regards,

     

    Pim

  • pflink
    pflink Member, ALL USERS, Certified Model Builder Posts: 4 Occasional Contributor
    @ChrisAHeathcote, thanks, this code will work for the next 80 years ;-), so I will apply this, much apreciated.
  • pflink
    pflink Member, ALL USERS, Certified Model Builder Posts: 4 Occasional Contributor
    @Misbah, great thanks, not needed for now,, but will be helpful in my next module. Kind regards, Pim