Combining of two DateFragment fields

Hi,

I have two DateFragment fields in our document model. One YYYY field and one MM field. I want to combine both through a computation into one DateFragment field with YYYY-MM. How could this be done?

Thanks in advance,
Nick

Hi @nick-linked-tensor
The first question that you need to ask is, what is this DateFragment and how can I use it? As you can see in the documentation, the following DateFragments can be compared with a Date Field.

  • YYYY
  • YYYY-MM

This is because they will be interpreted as dates by assuming the first day (and first month).

  • YYYY → 01.01.YYYY
  • YYYY-MMM → 01.MM.YYYY

So now that we know that DateFragments can be interpreted as Dates, let’s try and combine these inputs using Language Constructs for Dates.

Precondition

AllFieldsFilled(MonthFragment,YearFragment)

Calculation

Date("01",MonthFromDate(MonthFragment),YearFromDate(YearFragment))

2024.06-ext2 Model
DateFragments_DM.json (5.4 KB)