Datatype missing from Transpose result in a loop operation

I have created a workflow like this.

As the result of “Transpose node”, one column lost the type information.
So you can find the Row0 have a “?” here.

WS000000

To handle this, I tried “Column Auto Type Cast” and also with “Column Rename” node.

WS000002

The problem comes from this operation is in a Column list loop.
At the first iteration, Row0 is increased to Row1, that makes the following error.

WS000004

So the iterations output table contain different structure, which leads to a loop end fail finally.
It seems a simple question but I don’t know how to solve it.
Please give some advice. Thanks!

Hi @qianyi,

why don’t you insert the Column Auto Type Cast node and Column Rename node right after the Transpose node (Node 4)?

Andrew

2 Likes

Hi,

In case you have a special reason to keep your workflow the same as it is other than to do what @Andrew_Steel has suggested (to use nodes before the loop), you can use flow variables to handle the configurations in each iteration.
Here you can read more about making use of flow variables in KNIME:
https://blog.statinfer.com/knime-spirits-at-your-service/

Best,
Armin

Hi, @Andrew_Steel

I didn’t upload the result of Transpose node,
it includes 300 columns from Row0 ~ Row300, inputting to the Column List Loop start.
These Row names are generated from Tranpose node automatically.

WS

So this issue can be solved simply if I could rename all these 300 rows to one same column name.
Is this possible? :sweat_smile:

Hi, @armingrudd

Thank you for your share. I read the article, the flow variable configration is new to me and really helpful.

But I didn’t solve the issue in my workflow. When I tried to define the Row# column as a new variable, I can’t find “ColumnName” option in Flow Variable tab. I have tried to do this in Column List Loop Start node, RowID node, and String to Number Node.
Where is my mistake?

I share my workflow here.
Test_project4.zip (3.2 MB)

The main purpse of this workflow is to do the following operations row by row (iteration)
1.transpose the data of P[i] to one column. ( i is from 1 to 700)
2.make a time stamp column (700 rows).
3.Concatenate the columns of 1 and 2

A part of source data
WS000001
(P[1] … P[700])

The desired output of one row data from source file:
WS000000
(totally 700 rows)

I think there is better way to design the workflow for reach my desire and avoid this error. Would you please give me more advice?

Thanks!

Perhaps the data is also necessary so I upload 2 files for validation.

test_data.zip (3.6 MB)

Still some data files are missing.
Please export your workflow this way:
In “KNIME Explorer” panel right click on the workflow and select “Export KNIME Workflow…”. Uncheck “Reset Workflow(s) before export” and save the knwf file somewhere and then share file here.

Hi quanyi,

I think I know what you want … Change the order of Column Rename node and String to Number node and use a Column Rename (Regex) instead of Column Rename.

Bildschirmfoto%20von%202019-05-24%2014-39-23

Use Row(.+) as Search String and Value as Replacement String.

Bildschirmfoto%20von%202019-05-24%2014-39-37

and change the Include Column from String to Number to Value.

At least with the data from your test_data.zip this workflow works well.

Bildschirmfoto%20von%202019-05-24%2014-45-31

I hope this helps.
Andrew

Hi, @Andrew_Steel

It’s really helped! The workflow works well after I done your suggested change.
I will continue to create the rest of this workflow for handling my data.
Thanks again!

Hi, @armingrudd

I copied the workflow folder under the “knime-workspace” last time… :flushed:
I’m still new to KNIME, and Thanks your advice again!

Here is the workflow saving by the way you have shared. I upload it though the issue posted here have already been solved.
This workflow is not beautiful, but hope this informaiton could help somebody who read it in future.

Test_project4.knwf (3.2 MB)

1 Like

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