|
Home > Archive > BizTalk Server General > January 2006 > Urgent- "Grouping in Mapper"
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Urgent- "Grouping in Mapper"
|
|
|
| Hi Have following Data
<Input>
<record cat="A" value=900>
<record cat="B" value=400>
<record cat="A" value=100>
<record cat="B" value=300>
<record cat="B" value=1300>
</Input>
and I want to get the total values group by cat so the output will look
like
<Output>
<record cat="A" totalvalue=1000>
<record cat="B" totalvalue=2000>
</Output>
Any idea any help will be highly appreciated
| |
| Tom Lysholt Hansen 2006-01-13, 9:59 pm |
| Is the number of categories (and their names) fixed or dynamic?
If they are fixed, I suppose you could use the value mapping functoid in
combination with summing up.
--
Regards
Tom Lysholt Hansen
"Billa" wrote:
> Hi Have following Data
>
>
> <Input>
> <record cat="A" value=900>
> <record cat="B" value=400>
> <record cat="A" value=100>
> <record cat="B" value=300>
> <record cat="B" value=1300>
> </Input>
> and I want to get the total values group by cat so the output will look
> like
>
> <Output>
> <record cat="A" totalvalue=1000>
> <record cat="B" totalvalue=2000>
> </Output>
>
> Any idea any help will be highly appreciated
>
>
| |
|
| Thanks Tom,
They are not fixed and it could be anything. Any suggestion?
Regards,
Nadeem
Tom Lysholt Hansen wrote:[vbcol=seagreen]
> Is the number of categories (and their names) fixed or dynamic?
>
> If they are fixed, I suppose you could use the value mapping functoid in
> combination with summing up.
> --
> Regards
> Tom Lysholt Hansen
>
>
> "Billa" wrote:
>
| |
| Tom Lysholt Hansen 2006-01-13, 9:59 pm |
| Hi,
I'm affraid I have no suggestions on how to solve this problem. At least not
using BizTalk mapping. I've done some fairly complex mapping, and it often
turns out to be very nasty when dealing with dynamic stuff like yours.
I'm pretty sure, I wouldn't use BizTalk mapping in this case. You might be
able to write some XSLT you could use, but that's not a solution, I'd go for.
--
Regards
Tom Lysholt Hansen
"Billa" wrote:
> Thanks Tom,
> They are not fixed and it could be anything. Any suggestion?
>
> Regards,
> Nadeem
>
>
> Tom Lysholt Hansen wrote:
>
>
| |
| HablaElBiz 2006-01-13, 9:59 pm |
| Custom XSLT could be written and referenced in your btm map file to do
this kind of summing.
Here's a page that I've looked at in the past for how to do this:
http://www.jenitennison.com/xslt/gr.../muenchian.html
or just google for muenchian, or look at XSLT sites.
If you can map it with just XSLT and not clutter things with a
mysteriously functional map, why not? Isn't the mapper just a means to
an end? -> generated XSLT.
| |
| Tan Nguyen 2006-01-13, 9:59 pm |
| The mapper cannot do the grouping scenario below. My suggestion is to use
a scripting functoid and write some XSLT.
Regards,
Tan Nguyen
Microsoft BizTalk Server
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Billa" <BillaTilla@gmail.com>
| Newsgroups: microsoft.public.biztalk.general
| Subject: Urgent- "Grouping in Mapper"
| Date: 11 Jan 2006 09:26:26 -0800
| Organization: http://groups.google.com
| Lines: 20
| Message-ID: <1137000386.384826.246200@f14g2000cwb.googlegroups.com>
| NNTP-Posting-Host: 65.97.144.3
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1137000391 28654 127.0.0.1 (11 Jan 2006
17:26:31 GMT)
| X-Complaints-To: groups-abuse@google.com
| NNTP-Posting-Date: Wed, 11 Jan 2006 17:26:31 +0000 (UTC)
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET
CLR 1.1.4322),gzip(gfe),gzip(gfe)
| Complaints-To: groups-abuse@google.com
| Injection-Info: f14g2000cwb.googlegroups.com; posting-host=65.97.144.3;
| posting- account=iGEDWA0AAACAXR95MeNZrF1AY99Donv5
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!nntp.giganews.com!news-out.readnews.com!
news-xxxfer.readnews.com!postnews.google.com!f14g2000cwb.googlegroups.com!no
t-for-mail
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.biztalk.general:33906
| X-Tomcat-NG: microsoft.public.biztalk.general
|
| Hi Have following Data
|
|
| <Input>
| <record cat="A" value=900>
| <record cat="B" value=400>
| <record cat="A" value=100>
| <record cat="B" value=300>
| <record cat="B" value=1300>
| </Input>
| and I want to get the total values group by cat so the output will look
| like
|
| <Output>
| <record cat="A" totalvalue=1000>
| <record cat="B" totalvalue=2000>
| </Output>
|
| Any idea any help will be highly appreciated
|
|
| |
|
| Thanks Nguyen.
I don't know nothing about XSLT can u please guide me what would be the
XSLT and how should I use it in mapper? I sincerly appricate it. This
is the selling point of BizTalk (I want to implement BizTalk and my
management has asked me to do this), I can learn XSLT later.
Thanks in advance
Regards,
Tan Nguyen wrote:
> The mapper cannot do the grouping scenario below. My suggestion is to use
> a scripting functoid and write some XSLT.
>
> Regards,
> Tan Nguyen
> Microsoft BizTalk Server
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> --------------------
> | From: "Billa" <BillaTilla@gmail.com>
> | Newsgroups: microsoft.public.biztalk.general
> | Subject: Urgent- "Grouping in Mapper"
> | Date: 11 Jan 2006 09:26:26 -0800
> | Organization: http://groups.google.com
> | Lines: 20
> | Message-ID: <1137000386.384826.246200@f14g2000cwb.googlegroups.com>
> | NNTP-Posting-Host: 65.97.144.3
> | Mime-Version: 1.0
> | Content-Type: text/plain; charset="iso-8859-1"
> | X-Trace: posting.google.com 1137000391 28654 127.0.0.1 (11 Jan 2006
> 17:26:31 GMT)
> | X-Complaints-To: groups-abuse@google.com
> | NNTP-Posting-Date: Wed, 11 Jan 2006 17:26:31 +0000 (UTC)
> | User-Agent: G2/0.2
> | X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET
> CLR 1.1.4322),gzip(gfe),gzip(gfe)
> | Complaints-To: groups-abuse@google.com
> | Injection-Info: f14g2000cwb.googlegroups.com; posting-host=65.97.144.3;
> | posting- account=iGEDWA0AAACAXR95MeNZrF1AY99Donv5
> | Path:
> TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
> ne.de!border2.nntp.dca.giganews.com!nntp.giganews.com!news-out.readnews.com!
> news-xxxfer.readnews.com!postnews.google.com!f14g2000cwb.googlegroups.com!no
> t-for-mail
> | Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.biztalk.general:33906
> | X-Tomcat-NG: microsoft.public.biztalk.general
> |
> | Hi Have following Data
> |
> |
> | <Input>
> | <record cat="A" value=900>
> | <record cat="B" value=400>
> | <record cat="A" value=100>
> | <record cat="B" value=300>
> | <record cat="B" value=1300>
> | </Input>
> | and I want to get the total values group by cat so the output will look
> | like
> |
> | <Output>
> | <record cat="A" totalvalue=1000>
> | <record cat="B" totalvalue=2000>
> | </Output>
> |
> | Any idea any help will be highly appreciated
> |
> |
| |
| Sander Schutten 2006-01-13, 9:59 pm |
| Hi Billa,
First you need to know which cat values you have. This will need a
distinct select and the result should be put in a variable. E.g.:
<xsl:variable name="cats"
select="/Input/record/@cat[not(.=preceding::@cat]" />
Next you need to loop through each cat value and select the sum. E.g.:
<xsl:for-each select="$cats">
<xsl:variable name="catTotal" select="/Input/record/@total[@cat=.]"
/>
<record cat="{.}" totalvalue=="{$catTotal}">
</xsl:for-each>
I didn't test the xslt, but I hope this might give you a push in the
right direction.
| |
|
| Sander,
Thanks a lot!
I truly appreciate your time.
Regards,
Sander Schutten wrote:
> Hi Billa,
>
> First you need to know which cat values you have. This will need a
> distinct select and the result should be put in a variable. E.g.:
> <xsl:variable name="cats"
> select="/Input/record/@cat[not(.=preceding::@cat]" />
>
> Next you need to loop through each cat value and select the sum. E.g.:
> <xsl:for-each select="$cats">
> <xsl:variable name="catTotal" select="/Input/record/@total[@cat=.]"
> />
> <record cat="{.}" totalvalue=="{$catTotal}">
> </xsl:for-each>
>
> I didn't test the xslt, but I hope this might give you a push in the
> right direction.
|
|
|
|
|