Table of Contents

Search

  1. Preface
  2. XML Concepts
  3. Using XML with PowerCenter
  4. Working with XML Sources
  5. Using the XML Editor
  6. Working with XML Targets
  7. XML Source Qualifier Transformation
  8. Midstream XML Transformations
  9. Appendix A: XML Datatype Reference
  10. Appendix B: XPath Query Functions Reference

XML Guide

XML Guide

Using Multiple-Level Pivots

Using Multiple-Level Pivots

You can pivot more than one level of elements in a view by specifying fixed offsets for multiple-occurring elements in the XPath for a column. For example, you might have the following elements in a view:
STORE     PRODUCT+          PNAME          ORDER+          ORDERNAME              CUSTOMER+                   CUSTNAME
The XPath
STORE/PRODUCT[2]/ORDER[1]/ORDERNAME
refers to the ordername for the first order for the second product in the store. The XPath
STORE/PRODUCT[2]/ORDER/CUSTOMER[1]
refers to the first customer for all orders of the second product.
If you pivot a view row, any column in the XML view that occurs below the view row must have an XPath that matches XPath of the view row.
For example, a view might have the following view row:
Transaction/Trade[1]
The following columns have the same occurrence of Trade in the XPath:
Transaction/Trade[1]/Date Transaction/Trade[1]/Price Transaction/Trade[1]/Person[1]/Firstname
You cannot create a column with the following XPath in the view:
Transaction/Trade[2]/Date

0 COMMENTS

We’d like to hear from you!