Pages: [1]
  Print  
Author Topic: De-pivot excel file [SOLVED]  (Read 4674 times)
capson
Newbie
*
Posts: 8


« on: September 11, 2013, 06:10:04 PM »

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:
Quote
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
« Last Edit: September 12, 2013, 03:03:34 PM by capson » Logged
Marius
Administrator
Hero Member
*****
Posts: 1793



WWW
« Reply #1 on: September 12, 2013, 10:50:49 AM »

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
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
capson
Newbie
*
Posts: 8


« Reply #2 on: September 12, 2013, 01:32:52 PM »

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
« Last Edit: September 12, 2013, 01:35:18 PM by capson » Logged
Marius
Administrator
Hero Member
*****
Posts: 1793



WWW
« Reply #3 on: September 12, 2013, 01:35:07 PM »

What does this table mean?
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
capson
Newbie
*
Posts: 8


« Reply #4 on: September 12, 2013, 02:54:24 PM »

Thank you  I did not notice that "filed3|field4" the first filed3 was miss spelled, after correcting it all is working well.
« Last Edit: September 12, 2013, 02:56:14 PM by capson » Logged
Marius
Administrator
Hero Member
*****
Posts: 1793



WWW
« Reply #5 on: September 13, 2013, 12:24:40 PM »

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

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
Pages: [1]
  Print  
 
Jump to: