Pivot ok and pivot not ok order of columns

A strange thing happened to me in Knime 4.7.
I needed to pivot a table from data.
In the data there is a date from which I derived the year and month.
Then I decided to do a pivot in the columns I put the numeric value of the month because it is a floating period so this period starts with 7,8,9,10,11,12,1,2,3,4,5,6.
I was surprised that the pivot key sorted it so nicely.

Then I took another part of the data from this set and performed some operations but in this case I don’t know why but the pivot table failed to sort the data as in the previous case but it was just 1,2,3,4,5,6,7,8,9,10,11,12


knime_forum pivot_ok and pivot_not_ok.knwf (69.5 KB)

is it possible to somehow force special sorting in Pivot yes I can do it expost but it seems to me unnecessary to add work if in one case it goes and in the other not .
I used to work on a big reporting sw IBM Cognos where I could sort columns by invisible column in pivot table

Unfortunately the data is sensitive and I think it’s in there , so I can’t share it .
I tried to mask them but now it’s a bit different the system did this
4,6,7,8,9,10,12,1,2,3,5,11

members, please correct me if I’m wrong. i’m not an expert in knime, but it seems to me that the pivoted month table here is correlated to the ‘sorted selected columns’ values.

for example, when the required pivoted is ok (7, 8, 9, …) the required pivoted month is on top of the list.

similar also to the ‘pivot-not-ok workflow’, however, if i filter out the “value10” in the table, the sorted months change.and the pivoted follow accordingly.
image

my two cents.
rgds

1 Like

I did some experiments and when you add full version of date like 2021-10-06 instead 2021-10 it some how sorted base on dat.See picture except last one. :grinning:
image
The strange is that in columns name is date but front of date is I but probably it is releated to intersection of measure

hi @MarekV
hope you have already found a solution for your desired pivot-not-ok output month format.
for the purpose of experimenting, just throwing out some ideas here,
image
KNIME_pivot-not_ok_MM.knwf (151.9 KB)
rgds.

1 Like

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