Urgent- "Grouping in Mapper"
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > Urgent- "Grouping in Mapper"




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Urgent- "Grouping in Mapper"  
Billa


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 02:59 AM

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






[ Post a follow-up to this message ]



    RE: Urgent- "Grouping in Mapper"  
Tom Lysholt Hansen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 02:59 AM

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
>
>





[ Post a follow-up to this message ]



    Re: Urgent- "Grouping in Mapper"  
Billa


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 02:59 AM

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:
> 






[ Post a follow-up to this message ]



    Re: Urgent- "Grouping in Mapper"  
Tom Lysholt Hansen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 02:59 AM

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: 
>
>





[ Post a follow-up to this message ]



    Re: Urgent- "Grouping in Mapper"  
HablaElBiz


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 02:59 AM

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.






[ Post a follow-up to this message ]



    RE: Urgent- "Grouping in Mapper"  
Tan Nguyen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 02:59 AM

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
|
|






[ Post a follow-up to this message ]



    Re: Urgent- "Grouping in Mapper"  
Billa


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 02:59 AM

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; .NE
T
> 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-on
li
> ne.de!border2.nntp.dca.giganews.com!nntp.giganews.com!news-out.readnews.co
m!
> 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
> |
> |






[ Post a follow-up to this message ]



    Re: Urgent- "Grouping in Mapper"  
Sander Schutten


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-14-06 02:59 AM

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.






[ Post a follow-up to this message ]



    Re: Urgent- "Grouping in Mapper"  
Billa


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-17-06 10:58 PM

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.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:22 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register