![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi - I'm trying to parse the google analytics xml file returned from my data query. *Under the item node, there are two tags - dxp:dimension and dxp:metric that I need to extract the value from. *When I try my query, I get "XQuery [value()]: 'value()' requires a singleton (or empty sequence), found operand of type 'xdt:untypedAtomic *'". *I need to find a way around this but nothing yet. *A minimal example follows. |
#3
| |||
| |||
|
|
On Dec 17, 9:52 am, chris <chris.cio... (AT) gmail (DOT) com> wrote: Hi - I'm trying to parse the google analytics xml file returned from my data query. Under the item node, there are two tags - dxp:dimension and dxp:metric that I need to extract the value from. When I try my query, I get "XQuery [value()]: 'value()' requires a singleton (or empty sequence), found operand of type 'xdt:untypedAtomic *'". I need to find a way around this but nothing yet. A minimal example follows. Reply to my own message. Thanks for Bob in the "parse xml" thread, I got this to work: SELECT root.x.value('declare namespace dxp="http://schemas.google.com/ analytics/2009"; (dxp:dimension/@value, dxp:metric/@value)[1]', 'NVARCHAR(255)') AS a , root.x.value('declare namespace dxp="http://schemas.google.com/ analytics/2009"; (dxp:dimension/@value, dxp:metric/@value)[2]', 'NVARCHAR(255)') AS b FROM @x.nodes('rss/channel/item') root(x) Thanks Bob. . |
![]() |
| Thread Tools | |
| Display Modes | |
| |