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.

Sum by group Options · View
marcinm
Posted: Thursday, September 25, 2014 1:06:22 PM
Rank: Newbie

Joined: 6/3/2014
Posts: 3
Location: Poland
I have a problem with my mapping:
In XML file i have structure with multiple rows containing different VAT percent.
For every node there is a value of net price.
In Output file i need to recieve:
distinct percent values
sum of net price.

So for a combination of data:
1200, 7
1500, 23
120, 8
158, 7
177, 23

i need to retrieve:
1358 , 7
120, 8
1677,23

Anz ideas how to do it_
I tried group adjacent, mixed with sum functions but for me it seems to not work.

Anyone can help?
that
Posted: Thursday, September 25, 2014 1:53:05 PM
Rank: Advanced Member

Joined: 6/16/2006
Posts: 486
Location: AT
You need group-by and sum functions and these connections:

Source product -> group-by nodes/rows -> target product
Source VAT -> group-by key
Source price -> sum values -> target sum of price
Source VAT -> target VAT
Skrad
Posted: Thursday, October 30, 2014 9:08:31 AM
Rank: Member

Joined: 10/2/2014
Posts: 22
Hi there,

I am struggling with the same kind of issue, and I can't seem to resolve this.
When I create an output text file and a group by, I have my group by function working as it should, so it seems.
Input file is an Order XML with Stock keeping units.
There are Stock keeping Units with two orders on it, so you get two rows.
What I did is this:

Input Rows --> Group-by nodes/row --> output Rows
Stock keeping Unit --> Group-by key --> Output Unit

My output file gives me one row per Unit.

For a few units I get, for example, two orders and I want to add the amounts of both rows together and get a total in my output.
I have no clue where to build the Sum. I have tried searching online, tutorials and help files but I can't seem to find a detailed description of how to do this...
Any help is appreciated..

Thank you

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.