cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Help required in Node count

former_member1275317
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (5)

Answers (5)

Former Member
0 Kudos

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[]/

jyothi_anagani
Active Contributor
0 Kudos

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.

former_member187339
Active Contributor
0 Kudos

Hi,

Use like this

type--->exists \ Constant (0)

\ then /

\ /

or if -


> output

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

Regards

Suraj

Former Member
0 Kudos

did you tried the count function available ?

Rajesh

Shabarish_Nair
Active Contributor
0 Kudos

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