RapidMiner

RapidMiner

De-pivot excel file [SOLVED]

Contributor II

De-pivot excel file [SOLVED]

I am trying to de-pivot a excel file like below, the "NA" are null values, I have Field3 and field4 set as integers

I have:
attribute name >> edit list >> attribute name = field3 & atrributes = .*

index attribute = myNewFieldName
checked create nominal index
checked keep missings

I keep getting the error:
Process failed
"attributes have different value types: no conversion performed"


Any help is greatly appreciated
Thanks








id field1 field2 field3 field4
1 stuff aaa      4       3
2 stuff bbb      7       6
3 stuff ccc      NA    1
4 stuff ddd      3       3
5 stuff eee      9      NA
6 stuff fff        6      NA
5 REPLIES
Super Contributor

Re: De-pivot excel file

This depends on what you want to achieve... The problem, however, is that after De-Pivot all attributes that match the regular expression on the right side of "attributes = .*" will be located in the same column and thus must have the same value type. In your case .* matches all attributes, i.e. field1-4, that obviously have different value types. You can use either field1-2 or field3-4, which you can specify in the regular expression e.g. as "filed3|field4". Hope this helps!

Best regards,
Marius
Contributor II

Re: De-pivot excel file

Hello Marius (Nice mutton cop whiskers!), thanks for the response

I need,

id  field1  field2  Cnewfeld    Col5
1  stuff  aaa    field3          4
1  stuff  aaa    field4          3
2  stuff  bbb    field3          7
2  stuff  bbb    field4          6
3  stuff  ccc    field3          NA
3  stuff  ccc    field4          1
4  stuff  ddd    field3          3
4  stuff  ddd    field4          3
5  stuff  eee    field3          9
5  stuff  eee    field4          NA
6  stuff  fff      field3          6
6  stuff  fff      field4          NA
Super Contributor

Re: De-pivot excel file

What does this table mean?
Contributor II

Re: De-pivot excel file [SOLVED]

Thank you  I did not notice that "filed3|field4" the first filed3 was miss spelled, after correcting it all is working well.
Super Contributor

Re: De-pivot excel file [SOLVED]

Ups, sorry Smiley Happy Glad that it is working now!