Table manipulation

I have a table, and I would need to transform the first 3 rows of information into Columns.

I will send a picture as an example. But basically it would be like this. What is in red becomes a column and what is in blue remains the same.


KNIME_project.knwf (47.7 KB)

@takbb @rfeigel Can you help me as soon as possible? I have this very urgent need.I would like to thank you in advance for always helping me.

image

I needed this change too

Your request wasn’t very clear, especially for the final table. Check these tables and let me know whether they’re correct or not. I’m not going to post the workflow until you get back to me. There’s no point cluttering the Forum with stuff until I have a better idea what you want.



3 Likes

Table 2 series, I apologize for not making it clear. I will be trying to improve my ways of passing on the needs

What do you mean by “Table 2 series”?

You sent 3 tables, table 2 is the format I would like to obtain in my flow, could you please share how you arrived at this result?

I would only have one small change because I would like the month row to also be in a column instead of a row, where it says January, February, etc.

I have no idea what you want. The monthly columns repeat continuously throughout your original data. Are these different years or what?

Ok, I’ll try to start over so that it’s clear and I’ll use a simpler table. Once I find the logic I can apply it later, I need to create a data table. With all the data separated correctly by column, my main challenge is to simply transfer the lines that are currently year, unit and month to a column and leave the ones that are currently in a column the same way. I tried using Pivot and Unipivot but I couldn’t get it working.

I need the lines highlighted in blue, yellow and red to become columns and the ones in green to repeat for each year, unit and month. See images below.

Table to be modified

Table I want
image

Table :

Table manipulation.knwf (7.8 KB)

Try this. Its fairly complicated since the only way I could figure out how to construct the output table was to process each column in a separate workflow branch and then join everything. Maybe someone smarter than me could develop something more elegant. Frankly, your data is an absolute mess. If you can, you should work with whomever developed the original data format to construct something more straightforward.


2 Likes

Thanks for the help!! This data is really a mess. I’m trying to help a friend to solve it, I’ve never seen anything so messy when it comes to data.

2 Likes

If the workflow worked for you, please mark solved.

1 Like

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