Skip to Content
author's profile photo Former Member
Former Member

Mapping Help required in Node count

Hi Friends,

i need to count the number of occurences of source node. i'm able to count the occurences.

but i have some problem with this node. Source node happens only some times.

Source node.

<Event>

type- attribute

<Date>20092509</Date>

</Event>

Sometimes Event tag comes as </Event> without any type value then i need to pass " 0 " value.

Cases :

1. if empty Event tag happens then need to Pass "0"

2. <Event>

type

<Date></Date> in this case also need to pass 0.

3. <Event>

type "Order"

<Date>20092509</Date>

</Event>

<Event>

type "Delivery"

<Date>20092509</Date>

</Event>

in this case need to pass node count as "2"

please suggest me on this;

Regards,

Deeps

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 28, 2009 at 05:45 AM

    Hi,

    One option is to count the attribute.

    Other option is using if like if event exists and date exists and date length is greater than zero then count else count 0.

    Regards,

    ---Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 28, 2009 at 05:42 AM

    in your case since the conditions are as such its better to count the occurrences of the date field. Shouldn't that work?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 28, 2009 at 05:42 AM

    did you tried the count function available ?

    Rajesh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 28, 2009 at 05:50 AM

    Hi,

    Use like this

    type--->exists \ Constant (0)

    \ then /

    \ /

    or if -


    > output

    type --> equals "" / else(count) Event

    Regards

    Suraj

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 28, 2009 at 05:53 AM

    Hi sandeep,

    Map like this..

                         Date--\
                               then
    Date---->NotEquals---->if          -----\
     Constant[]/                             \
                              else            \
                Constant[0]/                   \
                                             then
    Date----->Exisists---->if--------        ----->Output
                                            else
                               Constant[0]/

    I tested this...

    Working Fine...

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 28, 2009 at 06:07 AM

    use the mapping follows

                                   event---->count...>map to then\
    type------>equalS----->not----->AND--------------------->IFTHENELSE....> target fiels
        constant[]/            
                                           constant[0] map  to else/
    Date----->equalS----->not----->map  to AND
      constant[]/
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.