Pivot node feature

3 views
Skip to first unread message

gbonamy

unread,
May 14, 2009, 2:21:03 PM5/14/09
to HiTS users
So as mentioned in issue 21: http://code.google.com/p/hits/issues/detail?id=21

I have been unabled to use Pivot to pivot the following table. However
using a few node combination in KNIME: GroupBy (agregate) >RegexSplit,
I was able to do what I wanted. The unpivot node could be used to

I am still unsure why the pivot node does not work, and I am a little
bit lost by your explanation. However I agree that a tool to sort data
in a table would be most useful.

Perhaps adding to "Data Manipulation > Column > Sort Columns" would
be great. I would make it so that the user can put in different
columns with different sorting orders and have the possibility to
indicate which sorting should take place first.

For instance,

Let Assume a table:

A;B;C;D

One may want to:
first sort A (from A-Z)
then sort C (from Z-A)
then sort D (from A-Z)

Also perhpas adding the option to sort all rows vs column only could
be useful.

Best,

Ghislain

aborg

unread,
May 14, 2009, 3:48:15 PM5/14/09
to HiTS users
Hi Ghislain,

Sorry about not being clear enough. The Domain Calculator in your
example does not work with the default settings, as in your case it
contains more than 60 values the ObjectIndex column. If you change
that option you will be able to run the workflow without getting the
nominal column error.
Although it is not possible to use it in this form.
But actually your idea with GroupBy, and RegexSplit is really good. :)
I had no idea it is possible.

I guess your sentence left unfinished related to Unpivot, but I guess
you did Column Filter, Unpivot(X-Y_Arr\[(\d+)\]), String to Number,
Rename, Sorter, Domain Calculator and finally Pivot. Giving the final
result. Actually this is a workaround, but really uncomfortable in my
opinion. But I am happy you have found it. :)

The pivot node does not work (in this case even if you used Domain
Calculator), because it expects the data in an order like this:
ObjectIndex|X-Y
0|48-489
1|480-491
...
574|855-1005
0|49-489
1|481-491
...
574|856-1005
...

The new node should merge the data with itself to achieve this form.

I am afraid I was not understanding your letter's second part. Do you
mean you want to use Data Manipulation/Row/Sorter?
Thanks for the feedback, gabor

aborg

unread,
Jun 3, 2009, 11:36:13 AM6/3/09
to HiTS users
Hi Ghislain,

I was working on the merging node, and realised that the manipulation
on this dataset is might be tricky. Your goal is to have the 1-Jan, 1-
Feb, ... values in the same column, or in the same row? (With merging
and Pivot node the result is in a column, while I guess in your case
it was in a row.) If you still have your dataflow, could you send me
the exported (without data)?
Thanks, gabor

On May 14, 7:21 pm, gbonamy <gbon...@gnf.org> wrote:

gbonamy

unread,
Jun 3, 2009, 11:47:44 AM6/3/09
to HiTS users
Gabor,

The data should not have had the dates embeded. I think excell
automatically converted this data to dates by accident. So you can
disregard this points where date are present.

Best,

Ghislain

Gábor Bakos

unread,
Jun 3, 2009, 12:02:31 PM6/3/09
to gbonamy, HiTS users
Hi Ghislain,

Thanks for the clarification. Although I am still curious what was your initial goal.
A table like this:
 48-489|480-491|593-582|387-926|...
 49-489|481-491|594-582|389-926|...
...

or a table like this:
0| 48-489| 49-489| 50-489| 51-489|...
1|480-491|481-491|482-491|483-491|...
...

Thanks, gabor

2009/6/3 gbonamy <gbo...@gnf.org>

gbonamy

unread,
Jun 3, 2009, 12:07:05 PM6/3/09
to HiTS users
Gabor,

This was a list of X-Y coordinates separated by a pipe. I do not much
care about having a padding (if anything the padding should probably
be a "0" rather than a space.

Perhaps this could be an option?

Best,

Ghislain

gbonamy

unread,
Jun 3, 2009, 6:54:59 PM6/3/09
to HiTS users
Gabor,

Sorry I had not seen this. by "|" do you mean a new column, or is it a
textual separator? If it is a column separator, then the following
would be better:
0| 48-489| 49-489| 50-489| 51-489|...
1|480-491|481-491|482-491|483-491|...

Best,

Gábor Bakos

unread,
Jun 4, 2009, 4:09:08 AM6/4/09
to HiTS users
Hi Ghislain,

The | sign was a column separator, you were right. Thank you the information. That one is not possible with the new Merge node + pivot, as it generates the other. I am not sure how good the result with a Transpose, if the content of columns is not String values... I guess this will require another node, or a new function in Pivot. This thread was really helpful for me.
Bests, gabor

2009/6/3 gbonamy <gbo...@gnf.org>
Reply all
Reply to author
Forward
0 new messages