Help

Re: Calculating cost through IS_BEFORE/AFTER & DATETIME_PARSE

351 0
cancel
Showing results for 
Search instead for 
Did you mean: 
James_Mendaros
4 - Data Explorer
4 - Data Explorer

I have a product the changes cost frequently and I want to track this cost change in one field. This original formula has been working for me but now I am trying to figure out how to calculate the cost between two dates.

For example:

  • Cost before 1/1/2020
  • Cost between 1/1/2020 - 1/1/2021
  • Cost after 1/1/2021

IF({Date},
IF(IS_BEFORE({Date},
DATETIME_PARSE( ‘1/1/2020’,’’)),
VALUE({Product}) * 0.62))
+
IF({Date},
IF(IS_AFTER({Date},
DATETIME_PARSE(‘12/31/2019’,’’)),
VALUE({Product}) * 0.53))
+
IF({Date},
IF(IS_BEFORE({Date},
DATETIME_PARSE(‘1/1/2021’,’’)),
VALUE({Product}) * 0.53))
+
IF({Date},
IF(IS_AFTER({Date},
DATETIME_PARSE(‘12/31/2020’,’’)),
VALUE({Product}) * 0.48))

1 Reply 1
James_Mendaros
4 - Data Explorer
4 - Data Explorer

bumping this post :slightly_smiling_face: