Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
briancla
New Member

XML with metadata and dat

I have an XML file that has metadata in one section and the data in another. The metadata has the column headings and format of the columns. How to I match up the metadata with the data?  XML is below.  Any help is appreciated

 

<?xml version="1.0" encoding="utf-8"?>
<dataset  xmlns="http://developer.cognos.com/schemas/xmldata/1/"  xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<!--
<dataset
    xmlns="http://developer.cognos.com/schemas/xmldata/1/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
    xs:schemaLocation="http://developer.cognos.com/schemas/xmldata/1/ xmldata.xsd"
>
-->
    <metadata>
          <item name="Contract Number" type="xs:string" length="32"/>
          <item name="Project Id" type="xs:string" length="18"/>
          <item name="Work Item" type="xs:string" length="18"/>
          <item name="Customer Number" type="xs:string" length="18"/>
          <item name="Customer" type="xs:string" length="72"/>
          <item name="Activity Code" type="xs:string" length="14"/>
          <item name="Activity Labor Description" type="xs:string" length="42"/>
          <item name="Week Ending Date" type="xs:date"/>
          <item name="Hours" type="xs:decimal" scale="2" precision="38"/>
          <item name="Labor Status" type="xs:string" length="18"/>
          <item name="Approval Status" type="xs:string" length="4"/>
          <item name="Approved Hours" type="xs:decimal" scale="1" precision="38"/>
          <item name="Approver Serial Number" type="xs:string" length="14"/>
          <item name="Sent To CFT Date" type="xs:date"/>
          <item name="Work Item Title" type="xs:string" length="122"/>
          <item name="Country Code" type="xs:string" length="8"/>
          <item name="Country" type="xs:string" length="62"/>
          <item name="OCC" type="xs:string" length="18"/>
          <item name="Charge Department" type="xs:string" length="18"/>
          <item name="Division" type="xs:string" length="6"/>
          <item name="Employee Last Name" type="xs:string" length="52"/>
          <item name="Employee Initials" type="xs:string" length="6"/>
          <item name="Employee Serial Number" type="xs:string" length="14"/>
          <item name="Employee Department" type="xs:string" length="18"/>
          <item name="Employee Department Type" type="xs:string" length="6"/>
          <item name="Employee Level" type="xs:string" length="4"/>
          <item name="Billing Code" type="xs:string" length="8"/>
          <item name="Account Description" type="xs:string" length="58"/>
          <item name="Sun Hours" type="xs:decimal" scale="2" precision="38"/>
          <item name="Mon Hours" type="xs:decimal" scale="2" precision="38"/>
          <item name="Tue Hours" type="xs:decimal" scale="2" precision="38"/>
          <item name="Wed Hours" type="xs:decimal" scale="2" precision="38"/>
          <item name="Thu Hours" type="xs:decimal" scale="2" precision="38"/>
          <item name="Fri Hours" type="xs:decimal" scale="2" precision="38"/>
          <item name="Sat Hours" type="xs:decimal" scale="2" precision="38"/>
          <item name="IW Insert Timestamp" type="xs:dateTime"/>
          <item name="Total(Total Hours Expended)" type="xs:decimal" scale="2" precision="38"/>
          <item name="Total(Approved Hours)" type="xs:decimal" scale="1" precision="38"/>
    </metadata>
    <data>
        <row>
            <value>CXXXXXX        </value>
            <value>WK3NW</value>
            <value>8GC0LB4S</value>
            <value>9204442</value>
            <value>SOSSEC                             </value>
            <value>GB018C</value>
            <value>SW INSTALLATION</value>
            <value>2019-08-23</value>
            <value>1.3</value>
            <value>ACTIVE</value>
            <value>A</value>
            <value>1.3</value>
            <value>5D1339</value>
            <value>2019-08-27</value>
            <value>Implem. Assist</value>
            <value>897</value>
            <value>United States of America      </value>
            <value>69SW-A26</value>
            <value>VJV     </value>
            <value>7G</value>
            <value>CLARK</value>
            <value>BE</value>
            <value>851203</value>
            <value>RKP</value>
            <value>HR</value>
            <value>D</value>
            <value>002</value>
            <value>Implem. Assist       </value>
            <value>0</value>
            <value>0</value>
            <value>0</value>
            <value>0</value>
            <value>0</value>
            <value>1.3</value>
            <value>0</value>
            <value>2019-08-23T12:03:25</value>
        </row>
        <row>
            <value>CXXXXXX        </value>
            <value>WK3NW</value>
            <value>8GC0LB4S</value>
            <value>9204442</value>
            <value>SOSSEC                             </value>
            <value>GB018C</value>
            <value>SW INSTALLATION</value>
            <value>2019-08-16</value>
            <value>0.8</value>
            <value>ACTIVE</value>
            <value>A</value>
            <value>0.8</value>
            <value>5D1339</value>
            <value>2019-08-19</value>
            <value>Implem. Assist</value>
            <value>897</value>
            <value>United States of America      </value>
            <value>69SW-A26</value>
            <value>VJV     </value>
            <value>7G</value>
            <value>CLARK</value>
            <value>BE</value>
            <value>851203</value>
            <value>RKP</value>
            <value>HR</value>
            <value>D</value>
            <value>002</value>
            <value>Implem. Assist       </value>
            <value>0</value>
            <value>0.2</value>
            <value>0.3</value>
            <value>0.1</value>
            <value>0.2</value>
            <value>0</value>
            <value>0</value>
            <value>2019-08-16T16:30:19</value>
        </row>
        <row>
            <value>CXXXXXX        </value>
            <value>WK3NW</value>
            <value>8GC0LB4S</value>
            <value>9204442</value>
            <value>SOSSEC                             </value>
            <value>GB018C</value>
            <value>SW INSTALLATION</value>
            <value>2019-08-09</value>
            <value>3.2</value>
            <value>ACTIVE</value>
            <value>A</value>
            <value>3.2</value>
            <value>5D1339</value>
            <value>2019-08-12</value>
            <value>Implem. Assist</value>
            <value>897</value>
            <value>United States of America      </value>
            <value>69SW-A26</value>
            <value>VJV     </value>
            <value>7G</value>
            <value>CLARK</value>
            <value>BE</value>
            <value>851203</value>
            <value>RKP</value>
            <value>HR</value>
            <value>D</value>
            <value>002</value>
            <value>Implem. Assist       </value>
            <value>0</value>
            <value>1.5</value>
            <value>0.8</value>
            <value>0.2</value>
            <value>0.6</value>
            <value>0.1</value>
            <value>0</value>
            <value>2019-08-09T13:54:39</value>
        </row>
        <row>
            <value>CXXXXXX        </value>
            <value>WK3NW</value>
            <value>8GC0LB4S</value>
            <value>9204442</value>
            <value>SOSSEC                             </value>
            <value>GB018C</value>
            <value>SW INSTALLATION</value>
            <value>2019-08-02</value>
            <value>1</value>
            <value>ACTIVE</value>
            <value>A</value>
            <value>1</value>
            <value>5D1339</value>
            <value>2019-08-07</value>
            <value>Implem. Assist</value>
            <value>897</value>
            <value>United States of America      </value>
            <value>69SW-A26</value>
            <value>VJV     </value>
            <value>7G</value>
            <value>CLARK</value>
            <value>BE</value>
            <value>851203</value>
            <value>RKP</value>
            <value>HR</value>
            <value>D</value>
            <value>002</value>
            <value>Implem. Assist       </value>
            <value>0</value>
            <value>0</value>
            <value>0</value>
            <value>0</value>
            <value>0</value>
            <value>1</value>
            <value>0</value>
            <value>2019-08-02T15:18:46</value>
            <value>6.3</value>
            <value>6.3</value>
        </row>
    </data>
</dataset>
1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @briancla ,

By loading the xml, I could get the table like below.

Untitled.png

I have a little confused about your desired output.


@briancla wrote:

I have an XML file that has metadata in one section and the data in another. The metadata has the column headings and format of the columns. How to I match up the metadata with the data? 


What do you mean match up the metadata with the data?

If it is convenient, could you describe your logic in details.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors