Quantcast
Channel: Active questions tagged worksheet-function - Super User
Viewing all articles
Browse latest Browse all 998

Identifying a Specific Table Hierarchy... Don't Know Where to Start

$
0
0

I am trying to identify/mark records where an entry exists in a specific column. While that may be pretty straightforward using a loop, I must also mark those records representing the "Parent" records. This is where I'm stuck.

Here is my starting data...

StartingData

Here is what I know so far... The data includes a list of different database tables. This Excel file is then imported into Lucidchart to create a table hierarchy diagram.

Only tables with an entry in the Tag column and their respective Parent Tables should be included in the load. This is accomplished by marking the Include column as "Yes" to filter the import for only the entries where Include = "Yes."

Pseudo-Code:

  1. Loop through each row and identify which ones have a value in the Tag column (the value does not matter).
  2. If the Tag column is populated, update the corresponding Include column with a "Yes" value. Example: The Software table has a Tag value of "Tag A." Therefore, update the corresponding Include column = "Yes"
  3. For each row that has a value in the Tag column, find its Parent Table and update the Parent Table row so that its Include column = "Yes."
  4. Continue updating the Parent Table rows until the Base table is reached (top of the table hierarchy). Example: The Windows Server table has a Tag entry. Therefore, update the corresponding Include column = "Yes" for the Windows Server, Server, Computer, Hardware, and Base tables

Here is the desired end state...

EndState

I think I need to do something with one or more arrays, but I'm having trouble figuring it out. Any help would be greatly appreciated!


Viewing all articles
Browse latest Browse all 998

Trending Articles