Selection of batch from running logic

Hello!!

Knime Experts Hope you are doing well.

Just need your help in solving following issue in creating workflow…

Requirement:

Select the such batch where expiry date is changed and reinstated to same date.

Batch Date on which change is made Time Expiry DateNew value Expiry DateOld value
AA321 20-03-2019 13:25:25 28-02-2019 28-02-2022
AA321 20-03-2019 13:16:25 28-02-2022 28-02-2019
AA321 20-03-2019 13:15:34 28-02-2022 28-02-2019
SPI008 15-02-2019 15:30:54 19-11-2020 0
SPI008 09-07-2019 17:38:53 19-11-2019 19-11-2020
SPI008 18-09-2019 16:41:37 19-11-2020 19-11-2020
SPI008 10-12-2019 12:13:56 21-11-2024 19-11-2020
ML3XZF 25-03-2019 13:40:41 31-01-2022 0
ML3XZF 20-05-2019 17:40:42 30-04-2022 31-01-2022
ML3XZF 28-08-2019 16:15:22 21-11-2024 30-04-2022
PAEF008 14-12-2019 11:49:11 10-11-2021 0
PAEF008 25-12-2019 14:11:26 10-05-2023 10-11-2021
PAEF008 27-12-2019 16:42:51 10-10-2021 10-05-2023
PAEF008 27-12-2019 17:20:50 10-11-2021 10-10-2021

Output:

Batch Date on which change is made Time Expiry DateNew value Expiry DateOld value
AA321 20-03-2019 13:25:25 28-02-2019 28-02-2022
AA321 20-03-2019 13:16:25 28-02-2022 28-02-2019
AA321 20-03-2019 13:15:34 28-02-2022 28-02-2019
SPI008 15-02-2019 15:30:54 19-11-2020 0
SPI008 09-07-2019 17:38:53 19-11-2019 19-11-2020
SPI008 18-09-2019 16:41:37 19-11-2020 19-11-2020
SPI008 10-12-2019 12:13:56 21-11-2024 19-11-2020
PAEF008 14-12-2019 11:49:11 10-11-2021 0
PAEF008 25-12-2019 14:11:26 10-05-2023 10-11-2021
PAEF008 27-12-2019 16:42:51 10-10-2021 10-05-2023
PAEF008 27-12-2019 17:20:50 10-11-2021 10-10-2021

Here batch-SPI008 is taken because on 15-02-2019 it’s expiry dt was created for first time as 19-11-2020, and it was changed on 09-2019 as 19-11-2019 and again it was reinstated on 18-09-2019 at 19-11-2020.(same logic for batch-PAEF008)

and for batch-AA321 on 20-03-2019 at 13:15:34(time) expiry dt was change from 28-02-2019 to 28-02-2022…it was again on same dt at 13:16:25(time) it was changed but kept dt same(it means some entry was done in system was done) and again at 13:25:25 (time) expiry dt is changed to 28-02-2019 which was original.

Thanks in advance.

@armingrudd Sir can you please guide me in this.

Hi @ravi13,

You can use the GroupBy node to calculate the count and the unique count of Expiry Date New values. Then the Rule-based Row Filter node to remove those with equal count and uqique count and finally, by using the Reference Row Filter node to exclude those batches which have duplicate Expiry Date New values.

Here is the Workflow:

23447-1-1.knwf (30.6 KB)

:blush:

4 Likes

Thanks @armingrudd for the solution.
And sorry for my late reply.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.