IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Dynamic Table Cell Values Options · View
patrickhorrigan
Posted: Wednesday, October 21, 2020 3:27:41 AM
Rank: Newbie

Joined: 10/14/2020
Posts: 2
I have been stumped by this problem and I am hoping someone on this forum may be able to help me out.

As a dynamic table is looping, I need to output a value based on the previous loop's element's value. I need to see if a element's value has changed from the previous loop, and if it has, output the difference between the current value and the previous value.

For example, using the following XML:

<FST type="Segment">
<FST01>22</FST01>
</FST>
<FST type="Segment">
<FST01>22</FST01>
</FST>
<FST type="Segment">
<FST01>22</FST01>
</FST>
<FST type="Segment">
<FST01>66</FST01>
</FST>
<FST type="Segment">
<FST01>66</FST01>
</FST>


I need to output the column values as follows:

FST01
22
0
0
44
0

Any help would be greatly appreciated.
Thank you in advance.

patrickhorrigan
Posted: Friday, October 23, 2020 12:35:00 AM
Rank: Newbie

Joined: 10/14/2020
Posts: 2
Hopes this helps others.
Here is an example of the working code:

if (number(./preceding-sibling::n1:FST[1]/n1:FST01) = (./preceding-sibling::n1:FST[1]/n1:FST01))
then
if ((n1:FST01) - (./preceding-sibling::n1:FST[1]/n1:FST01) > 0)
then (n1:FST01) - (./preceding-sibling::n1:FST[1]/n1:FST01)
else ''
else n1:FST01
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.