# Adding and subtracting dates in ColumnExpressions

**URL:** <https://forum.knime.com/t/adding-and-subtracting-dates-in-columnexpressions/12110>\
**Category:** KNIME Analytics Platform\
**Created:** [September 20, 2018, 6:18pm UTC](https://forum.knime.com/t/adding-and-subtracting-dates-in-columnexpressions/12110 "2018-09-20T18:18:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CobusSmit](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@CobusSmit](https://forum.knime.com/u/CobusSmit)\
**Post date:** [September 20, 2018, 6:18pm UTC](https://forum.knime.com/t/adding-and-subtracting-dates-in-columnexpressions/12110/1 "2018-09-20T18:18:54Z")

</div>

I am currently manipulating a set of dates in a single table with different “categories of dates”. I am currently identifying a marker in one column (e.g. LY\_YTD\_Act or TY\_YTD\_Act) and populate a new column with a date plus or minus another date to interpret these markers.

I thought column expressions may do the trick here - I set a base date using a flow variable from a quick form and then assign the date value. Problem is that I am unable to increase/decrease the date value relative to the base value and can’t find an appropriate syntax for it.

My initial ColumnExpression syntax is:  
if (column(“ValueType”) == ‘TY\_YTD\_Act’) ValueDateTime = variable(“ValueDate”);

I now only need to manipulate the date e.g.  
if (MARKER\_1) then ValueDateTime = FlowVariableDate + [year/month/day]; //pseudo code

Any advice is appreciated.

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [September 21, 2018, 7:28am UTC](https://forum.knime.com/t/adding-and-subtracting-dates-in-columnexpressions/12110/2 "2018-09-21T07:28:09Z")

</div>

Hi there!

Not sure I understand. Maybe an example?

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:30pm UTC](https://forum.knime.com/t/adding-and-subtracting-dates-in-columnexpressions/12110/3 "2023-06-23T20:30:54Z")

</div>


