locked
filter in maps RRS feed

  • Question

  • Hi

    In my map in the target schema I need only records where Category is "LP" so I have used a equal functoid and a looping functoid. I am mapping the equal functoid to Category field from the source schema and to the Products tag in the target schema and the looping functoid is mapped to the Products tag from the source and destination schema.
    This works fine but I also have a RecordCount field in the target schema which should be the count of records so I have used the record count functoid and mapped the Products tag from the source to the RecordCount in destination schema. But the value of RecordCount is always the number of records prior to the filtering criteria (that is If i have 20 records and 7 of them have Category as "LP" then RecordCount should be 7 but I always get 20)

    What have I done incorrect here?

    Thanks

    Wednesday, June 10, 2015 4:32 AM

Answers

  • Hi,

    RecordCount functoid will not serve the purpose over here, as it generate the value of how many times a record or field element occurs in a message instance.

    You can use Cumulative sum in your map to get the total number of records with ""LP" category.

    You can design your schema something like below:

    In the Equal to functoid I am chking if category is equal to "LP", if it returns true than Value mapping functoid passes integer "1" to the Cumulative Sum sum functoid.

    I hope this will work!!


    Thanks, Girish R. Patil.

    • Proposed as answer by Ravindar Thati Wednesday, June 10, 2015 6:21 AM
    • Marked as answer by Angie Xu Tuesday, June 16, 2015 2:08 PM
    Wednesday, June 10, 2015 5:03 AM