concat columns in a certain order

Hey,
I have a column which contains addresses. They are not cleaned. I have run a python script and the output looks something like the attachment,Addresses.txt (1.0 KB)

When i pivot them the order changes. (I need to pivot because i need to clean few types of addresses. There are 8M rows of data)

When i do the text cleansing, and I want to concat them, is there any way they can be concatted in the order they were before the pivot? Like add an index before pivot or something,

Any suggestion would be helpful

Hi @aishp, welcome to the forum.

I think the problem is that you have different address headings for each entry. Therefore not every row after pivoting will contain the same information.

The order of the resulting columns is dependent on the information present in the first row. If on the Pivoting tab you deselect “Ignore domain”, the situation improves a bit, but the column order won’t apply to every row in your dataset.

I’m not sure this matters however. The String Manipulation node will allow you to join the contents of 2 string columns in whatever order you’d like.

If you really want to change the order of the columns, then the Column Resorter node allows you to do that.

1 Like

Hey, I tried that but. the thing is…
Let’s say for some addresses it is like #235 xyz CA or for some it is abc #567 LA. So the numbers are in one column, state name in one column and the rest in another. After Pivot and Concat i want to maintain the order as per the input row. Can this be possible? Or it is just an impossible case. Right now the output for both is #235 cxy CA, #567 abc LA.

Hi there @aishp,

welcome to KNIME Community!

not sure I understand what is troubling you. Can you create workflow example and share it? From experience this is the fastest way to get help/solution/ideas. See here how to do that:

Br,
Ivan

Hey, I tried that but. the thing is…

What exactly is it that you tried? It would be helpful if you provided a workflow so that we can see how you’ve been approaching the problem.

I suppose I don’t understand what you mean by concatenate, and so it’s unclear to me what the problem is.

With the example data and processes you’ve hinted at, I can get this result:

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