Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help with loading xml

Hi

Need to load the attached excel and load the data as following where the attribute id is column name

SYSTEM ID ,0x11f56,0x12d7f,0x12b4c

1000,4,10.XX.YY.XXX,DOWN

1001,4,10.xx.x.xx,UP

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

This will do it

System:

Mapping LOAD %Key_SYSTEM_E1A50E403A5F81B7 as %Key1,

  id

FROM (XmlSimple, Table is [SYSTEM-response-list/SYSTEM-responses/SYSTEM]);

Attributes:

Mapping LOAD RowNo() As %Key2,

  attribute%Table

FROM (XmlSimple, Table is [SYSTEM-response-list/SYSTEM-responses/SYSTEM/attribute]);

AttributeID:

LOAD id,

  ApplyMap('System', %Key_SYSTEM_E1A50E403A5F81B7) As SystemID,

  ApplyMap('Attributes', RowNo()) As Value

FROM (XmlSimple, Table is [SYSTEM-response-list/SYSTEM-responses/SYSTEM/attribute]);

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

This will do it

System:

Mapping LOAD %Key_SYSTEM_E1A50E403A5F81B7 as %Key1,

  id

FROM (XmlSimple, Table is [SYSTEM-response-list/SYSTEM-responses/SYSTEM]);

Attributes:

Mapping LOAD RowNo() As %Key2,

  attribute%Table

FROM (XmlSimple, Table is [SYSTEM-response-list/SYSTEM-responses/SYSTEM/attribute]);

AttributeID:

LOAD id,

  ApplyMap('System', %Key_SYSTEM_E1A50E403A5F81B7) As SystemID,

  ApplyMap('Attributes', RowNo()) As Value

FROM (XmlSimple, Table is [SYSTEM-response-list/SYSTEM-responses/SYSTEM/attribute]);

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

HI i Want to create 3 columns as 0x11f56,0x12d7f,0x12b4c  along with its values but here only one colum id is getting genarated

Not applicable
Author

sunindia

Some of the values in Value Column are in HEX format. How do i convert those in Decimal in load Script here

jonathandienst
Partner - Champion III
Partner - Champion III

Like this:

     Num(Num#('C7', '(HEX)'))

Num# interprets the hex value, Num formats it to display decimal

The case of HEX should be the same as the case of the A-F in the hex number.

     Num(Num#('c7', '(hex)'))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein