Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6009311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:57:09+00:00 2026-05-23T01:57:09+00:00

I’ve been trying to apply xsl to the result set returned by Analysis Service

  • 0

I’ve been trying to apply xsl to the result set returned by Analysis Service database.
The result set looks like the following…

<Axis name="Axis1">
  <Tuples>
    <Tuple>
      <Member Hierarchy="[Org].[Class1]">
        <UName>[Org].[Class1].&amp;[10629]</UName>
        <Caption>Independent</Caption>
        <LName>[Org].[Class1].[Ownership]</LName>
        <LNum>2</LNum>
        <DisplayInfo>65898</DisplayInfo>
        <PARENT_UNIQUE_NAME>[Org].[Class1].&amp;[2]</PARENT_UNIQUE_NAME>
      </Member>
    </Tuple>
    <Tuple>
      <Member Hierarchy="[Org].[Class1]">
        <UName>[Org].[Class1].&amp;[14331]</UName>
        <Caption>A #5839</Caption>
        <LName>[Org].[Class1].[Owner Region]</LName>
        <LNum>3</LNum>
        <DisplayInfo>65537</DisplayInfo>
        <PARENT_UNIQUE_NAME>[Org].[Class1].&amp;[10629]</PARENT_UNIQUE_NAME>
      </Member>
    </Tuple>
    ....
  </Tuples>
</Axis>

<CellData>
  <Cell CellOrdinal="0">
    <FmtValue>Ownership</FmtValue>
  </Cell>
  <Cell CellOrdinal="1">
    <ForeColor>0</ForeColor>
    <FmtValue>73%</FmtValue>
  </Cell>
  <Cell CellOrdinal="2">
    <ForeColor>0</ForeColor>
    <FmtValue>68%</FmtValue>
  </Cell>
  <Cell CellOrdinal="3">
    <ForeColor>0</ForeColor>
    <FmtValue>70%</FmtValue>
  </Cell>
  <Cell CellOrdinal="4">
    <ForeColor>0</ForeColor>
    <FmtValue>59%</FmtValue>
  </Cell>
  <Cell CellOrdinal="5">
    <FmtValue>Owner Region</FmtValue>
  </Cell>
  <Cell CellOrdinal="6">
    <ForeColor>0</ForeColor>
    <FmtValue>75%</FmtValue>
  </Cell>
  .....
</CellData>

Each Tuple above has a corresponding set of Cells in the CellData.
So, if the file is parsed sequentially, the relevant cells can be gathered using the position() of the Tuple.

However, if the Tuple is sorted using xsl-sort, LNum property, and iterated over using for-each, the position of the Tuples is now changed and so can not find the corresponding Cell for the Tuple.

How can I keep track of the Tuple ordinal based on UName, so that I can get to the relevant cell.
I have created a key for the UName as

<xsl:key name="tuples-by-uName" match="/xa:root/xa:Axes/xa:Axis/xa:Tuples/xa:Tuple" use="xa:Member/xa:UName" />
<xsl:key name="tuples-by-parentUName" match="/xa:root/xa:Axes/xa:Axis/xa:Tuples/xa:Tuple" use="xa:Member/xa:PARENT_UNIQUE_NAME" />

And want to iterate over the tuples using something like the following.

<xsl:for-each select="key('tuples-by-parentUName', $thisQuestion/xa:Member/xa:UName)">
<xsl:sort data-type="number" select="xa:Member/xa:LNum" order="descending"/>

Here I need the original position of the Tuple so I can calculate the position of the Cell.

Have spent a lot of time, but can not figure this one out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:57:10+00:00Added an answer on May 23, 2026 at 1:57 am

    Within the xsl:for-each:

    <xsl:variable name="originalPosition" select="count(preceding::xa:Tuple) + 1"/>
    

    or

    <xsl:variable name="originalPosition">
        <xsl:number count="xa:Tuple" level="any"/>
    </xsl:variable>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a text area in my form which accepts all possible characters from
I'm parsing an XML file, the creators of it stuck in a bunch social

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.