Skip to main content
Question

Database operations

  • March 12, 2026
  • 1 reply
  • 14 views

Forum|alt.badge.img

HI, this is my input excel, will be read as datatable. 

I want build some like below as output, Process step and Doc ID is unique and repeated part numbers should be append. How can I achieve this to get datatable as output/

DocID ProcessStep PN
D00331953 HA_SETSIT_ITS 21013568;21029686;21029687
D00331953 HA_RFTEST_ITS 21013568;21029686;21029687
D00330817 HA_RECONFIG_ITS 21013568;21029686;21029687
D00330817 HA_TRIMCHK_ITS 21013568;21029686;21029687

1 reply

dgabbad369
Forum|alt.badge.img+2
  • Cadet | Tier 2
  • March 13, 2026

Hi ​@amith7503,

If you are using Excel as a database, first query the sheet to get the distinct combinations of DocID and ProcessStep. Then, loop through each unique combination. Inside the loop, run a second SELECT query to retrieve all PN values matching the current DocID and ProcessStep. After collecting all the PN values, join them into a single semicolon‑separated string and insert a new row into the output DataTable containing: DocID, ProcessStep, and the concatenated PN list.

If you are not using Excel as a database, you can achieve the same result using Excel Advanced commands.