Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have the following table
SHIP | PERIOD | START_DATE | END_DATE | VALUE |
2803845 | 201802 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201802 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201802 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201803 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201803 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201803 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201804 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201804 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201804 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201805 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201805 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201805 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201806 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201806 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201806 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201807 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201807 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201807 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201808 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201808 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201808 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201809 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201809 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201809 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201810 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201810 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201810 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201811 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201811 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201811 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201812 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201812 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201812 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201901 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201901 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201901 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201902 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201902 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201902 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201903 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201903 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201903 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201904 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201904 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201904 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201905 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201905 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201905 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201906 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201906 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201906 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201907 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201907 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201907 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201908 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201908 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201908 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201909 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201909 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201909 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201910 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201910 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201910 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201911 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201911 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201911 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 201912 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201912 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201912 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 202001 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 202001 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 202001 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 202002 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 202002 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 202002 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 202003 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 202003 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 202003 | 4/1/2020 | 1/3/2020 | 1 |
What I need to do is compare if the Period is in the range Start_Date/End_Date and bring a single row per Period with the Value associated to that Period:
SHIP | PERIOD | START_DATE | END_DATE | VALUE |
2803845 | 201802 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201803 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201804 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201805 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201806 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201807 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201808 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201809 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201810 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201811 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201812 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201901 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201902 | 4/2/2018 | 3/2/2019 | 3 |
2803845 | 201903 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201904 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201905 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201906 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201907 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201908 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201909 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201910 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201911 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 201912 | 4/2/2019 | 3/1/2020 | 4 |
2803845 | 202001 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 202002 | 4/1/2020 | 1/3/2020 | 1 |
2803845 | 202003 | 4/1/2020 | 1/3/2020 | 1 |
Is there any way to do that?
Thank you!!
you dont need intervalmatch just use an if statement when loading:
=if(date(right('201802',2)&'/01/'&left('201802',4))>=startdate and date(right('201802',2)&'/01/'&left('201802',4))<=enddate, ....
note though that your period is month date so you need to define the business rules, will 02/2018 be in the period 02/15/2018 to 03/15/2018? if so:
=if(date(right('201802',2)&'/01/'&left('201802',4))>=monthstart(startdate) and date(right('201802',2)&'/01/'&left('201802',4))<=monthend(enddate), ....