How to get the corresponding month name from a weeknumber?

good to see you solved this part of the puzzle @Xavier_Rabilloud !

you might want to go even one step further. sometimes you have two months in one week. below the steps to force a choice.

and in the last step I make some hard coded choices and these you can put as you see fit. Here is equal or greater than 4 days

As always, this can be put into one formula. However to understand the steps, this might be easier to follow.

Sequence(thisRow.from,thisRow.to).Filter(CurrentValue.IsoWeekNumber() = thisRow.[my weeknumber]).FormulaMap(CurrentValue.Monthname()).WithName(TheMonts,
  
  Sequence(1,TheMonts.Count()).FormulaMap(TheMonts.Nth(CurrentValue) = theMonts.First()).CountIf(CurrentValue=True()).WithName(OutCome, 
    
    If(OutCome >=4,TheMonts.First(),TheMonts.Last()
    )
   )
  )

1 Like