repeating elements

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Nagaraj
Premium Member
Premium Member
Posts: 383
Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore

repeating elements

Post by Nagaraj »

Hi Folks,

- <measure-group ID="X">
- <p1>
<C>Y</C>
<D />
<E />
- <p2>
<p2-number>ABC</p2-number>
<eligible-instances>16</eligible-instances>
<meets-performance-instances>28</meets-performance-instances>
<performance-rate xsi:nil="true" />
</p2>
</p1>
- <p1>
<C>Y</C>
<D>2011-04-01 00:00:00</D>
<E>2011-06-30 00:00:00</E>
- <p2>
<p2-number>EFG</p2-number>
<eligible-instances>1</eligible-instances>
<meets-performance-instances>2</meets-performance-instances>
<performance-rate xsi:nil="true" />
</p2>
</p1>

target xml output stage

target xml output stage

i am getting these elements repeated for all the rows

<C>Y</C>
<D>2011-04-01 00:00:00</D>
<E>2011-06-30 00:00:00</E>

i want the above to appear only once.

things i have done.

made this column <p2-number> as KEY.

aggreate all rows check boxed in target output stage.
Nagaraj
Premium Member
Premium Member
Posts: 383
Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore

Post by Nagaraj »

And also

made the last element as XML

<performance-rate xsi:nil="true" />
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

hard to tell, but it "looks" like p2 is your "inner" repeating group, and p1 is the "parent". ....and the C and D cols are desired to be at the "parent" level.

One would guess that the xpath for this looks something like:

.../p1/C/text()
.../p1/D/text()
.
.
.
.../p1/p2/p2_number/text()

etc.

Make sure the only "key" selected for this link is "inside" p2. ...such as P2 number.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Nagaraj
Premium Member
Premium Member
Posts: 383
Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore

Post by Nagaraj »

duplicate post
Last edited by Nagaraj on Fri Apr 15, 2011 2:59 pm, edited 1 time in total.
Nagaraj
Premium Member
Premium Member
Posts: 383
Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore

Post by Nagaraj »

Ernie,

i was able to get this before, but with the new change, i am loosing this.

i made the last column as transformation to produce as
<performance-rate xsi:nil="true" />
Nagaraj
Premium Member
Premium Member
Posts: 383
Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore

Post by Nagaraj »

duplicate post
Last edited by Nagaraj on Fri Apr 15, 2011 2:59 pm, edited 1 time in total.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Not sure....but carefully check your incoming data. And run with a tiny number of input records that you are intimately familiar with.

I didn't have time to absorb all of your data values, but it "looks" like you want to have one set of repeating groups for the single combination of npi/tin numbers that are at the top....but...

...for the same npi/tin combination, your dates are different. Find out why. That may not be the issue, but it would certainly be something to dig into.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Nagaraj
Premium Member
Premium Member
Posts: 383
Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore

Post by Nagaraj »

ahh right
Not sure....but carefully check your incoming data. And run with a tiny number of input records that you are intimately familiar with.

I didn't have time to absorb all of your data values, but it "looks" like you want to have one set of repeating groups for the single combination of npi/tin numbers that are at the top....but...

...for the same npi/tin combination, your dates are different. Find out why. That may not be the issue, but it would certainly be something to dig into.
from your suggestion if found the issue is the repeating group, its a data issue,

thanks for your time ernie,
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

No problem. Glad to be of help.....

..for anyone reading this, keep in mind that it's not just the syntax that will impact what your resulting document looks like. In this case there were "two" records at the higher level, so it had no choice but to cut another parent group.

Know your data.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Nagaraj
Premium Member
Premium Member
Posts: 383
Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore

Post by Nagaraj »

Yes i agree :) thanks ernie a lot. have a gr8 weekend.
Post Reply