Building countries hierarchy in KNIME

hello, I am try to build a country hierarchy data with 8 columns.
I have columns containing global, region, country, state, city. there are multiple records for each hierarchy.
I want to transpose this data to a new column location. I want he Location column to follow the order of the current columns such that location is Global > region> country > state > city. for each unique location

I have tried the transpose node and the output in incorrect. Please help

Hi @theMaryamO,

i’m not sure if i get your question correct. But based on your information i tend to use first the group by node by assigning all columns into the group columns to generate unique row combinations. Then use the sorter node to arrange the data based on your hierarchy criteria.

Uploading an example file together with an expected outcome, makes it much easier to understand your question and find a solution.


1 Like

My table looks like this :

|Global || Region || Country || State || City
Global Africa Liberia Lofa Agikolazizu
Global Americas USA Ohio Cincinnati

I want add a Location column and have the table look like this

| Location || Global || Region || Country || State || City
Global Global Global Global Global Global
Africa Global Africa none none none
Americas Global Americas none none none
Liberia Global Africa Liberia none none
USA Global Americas USA none none
Lofa Global Africa Liberia Lofa none
Ohio Global Africa Liberia Ohio none
Agikolazizu Global Africa Liberia Lofa Agikolazizu
Cincinnati Global Africa Liberia Lofa Cincinnati

I look forward to your assistance, thanks

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