Forum Discussion

WGAP47573's avatar
WGAP47573
Frequent Visitor
2 years ago
Solved

Extract data from a table iterating from 2 columns

Hi community,

I'm requiring your valuable support to build the script to extract data from table "test_lookup" which contains this information:

test_idref_codebench_idresultstart_datetimeend_datetime
Test_1code_ABVS-001PASS11/05/2023 08:40:2111/05/2023 08:49:55
Test_2code_ABVS-001PASS

20/06/2023

18:40:09

20/06/2023 18:49:43
Test_3code_ABVS-001PASS

 

25/11/2023 09:37:23

25/11/2023 09:46:57
Test_4code_ABVS-001PASS26/11/2023 16:17:4326/11/2023 16:27:17
Test_5code_ABVS-001PASS15/04/2024 15:50:1115/04/2024 15:59:45
Test_6code_ABVS-002PASS04/03/2023 12:27:0404/03/2023 12:36:38
Test_7code_ABVS-002PASS13/03/2023 00:28:1613/03/2023 00:37:50
Test_8code_ABVS-002PASS19/06/2023 09:39:0219/06/2023 09:48:36
Test_9code_ABVS-002FAIL15/02/2024 11:00:3515/02/2024 11:07:38
Test_10code_ABVS-003PASS19/04/2023 10:03:4319/04/2023 10:13:17
Test_11code_ABVS-003PASS01/10/2023 07:19:0301/10/2023 07:28:37
Test_12code_ABVS-004FAIL30/08/2023 01:31:3330/08/2023 01:40:57
Test_13code_ABVS-004PASS15/10/2023 23:18:0515/10/2023 23:27:39
Test_14code_ABVS-004PASS06/04/2024 23:32:5206/04/2024 23:42:26
Test_15code_ABVS-005PASS07/05/2023 19:36:3107/05/2023 19:46:05
Test_16code_ABVS-005FAIL29/08/2023 05:08:0129/08/2023 05:15:04
Test_17code_ABVS-005PASS08/11/2023 21:46:5108/11/2023 21:56:25
Test_18code_ABVS-005PASS29/11/2023 19:05:5529/11/2023 19:15:29
Test_19code_BBVS-001FAIL12/04/2024 05:50:0612/04/2024 05:57:09
Test_20code_BBVS-002PASS08/09/2023 01:21:2608/09/2023 01:31:00
Test_21code_BBVS-002PASS14/10/2023 02:23:3414/10/2023 02:33:08
Test_22code_BBVS-003PASS07/02/2024 10:07:4707/02/2024 10:17:21
Test_23code_BBVS-004PASS14/03/2023 08:38:5914/03/2023 08:48:33
Test_24code_BBVS-004PASS02/01/2024 19:48:1902/01/2024 19:57:53
Test_25code_BBVS-005FAIL17/06/2023 21:06:4917/06/2023 21:15:29
Test_26code_BBVS-005PASS04/04/2024 01:53:5204/04/2024 02:03:26

 

I need to extract for every "rfid_code" the 3 "test_id"s with the most recent date.  Expected result as follow:

rfid_codetest_idstart_datetime
code_ATest_515/04/2024 15:50:11
code_ATest_1406/04/2024 23:32:52
code_ATest_915/02/2024 11:00:35
code_BTest_1912/04/2024 05:50:06
code_BTest_2604/04/2024 01:53:52
code_BTest_22

07/02/2024 10:07:47

 

The idea is to use it as filter in different visuals.

 

Thanks in advance for your valuable support.

 

Kind regards,

WGAP47573