Customer Portal

How to find total number of in records and increment

Comments 6

  • Avatar
    slechtaj
    0
    Comment actions Permalink
    Hi Sandeep,

    I’m not sure if you want to get a serial number of a row or total count of all records that went through an edge. Therefore I have prepared for you an example that answers both your questions.

    Basically to get a serial number of some record, you might use a simple CTL transformation within a Reformat component, where you will use a variable that you increase by one with every single incoming record.
    However, if you want get total number of records, you might take into consideration using Aggregate component. See attached graph for more details.

    Hope this helps.
  • Avatar
    sandeepbharmoria
    0
    Comment actions Permalink
    Thanks So much...

    Now I am clear on this,

    My doubt was regarding why the variable wasn't incrementing , so now I understood that the variable should also go in some outport to get incremented...

    Is there any way to increment the variable, without sending variable to out port in reformat component.

    Thanks So Much again

    Regards,

    Sandeep Thakur
  • Avatar
    slechtaj
    0
    Comment actions Permalink
    Hi Sandeep,

    If I understand your question, you want to work with total record count value (integer) just like with any other variable in CTL. However, since Reformat processes records one by one, it starts processing data even before receiving all records. This approach is faster as it does not require waiting for all records to be processed by preceding component. Therefore when Reformat starts to process records it doesn't know yet how many records it will receive.

    Therefore you should start thinking about another approach. Maybe if you told us what exactly you have on input of the Reformat and what is supposed to be returned on output, we might help you find a different way.
  • Avatar
    sandeepbharmoria
    0
    Comment actions Permalink
    I really appreciate the way you cleared my queries.

    I am bringing in RSS feeds from a web site using xml extractor and then using Universal reader (source) to fetch the source of RSS component.Problem is that I want to extract the title, description and Url of the RSS feed using xml extractor and in parallel want to fetch the source of RSS feed URL
    (Which is HTML source text ) and attaching them as one record finally. (Which I was not able to achieve).

    So What I thought is, I firstly fetched source of RSS URL's and named it as rss$.html in phase 0. And in phase 1, I am fetching link{},Title{}, description{}
    and then I am trying to add an file system url , which will point to each relative RSS news source in file system, so i thought of putting an variable RSS+i+.html. So automatically I will get an RSS feed pointer.

    Quite complex thinking..:) I know there might be other ways, but I was not able to figure out, so I invested some time in thinking my own resolution..
    (may be funny)

    Please suggest some good way to achieve above..


    Regards

    Sandeep Thakur
  • Avatar
    slechtaj
    0
    Comment actions Permalink
    Hi Sandeep,

    Please correct me if I do not understand you question. You want to fill the following metadata:
    Link ; Title ; Description ; Content

    Where the first three fields are retrieved directly from RSS feed XML tags, and the fourth is the content of the file that is available under the link from the first field. If that is true, you do not need to do any CTL transformation. The only thing you need to do is to split the XMLExtract output stream into two records. For this purpuse you may use SimpleCopy component. On the second branch you will put UniverasalDataReader, which will return the whole content of the file (retrieved from the link tag) into one field. Since the number and order of the records on both branches are identical, we can use Combine component to merge these data together.

    For more information, please see attached graph.

    Hope this helps.
  • Avatar
    sandeepbharmoria
    0
    Comment actions Permalink
    In single word "Awesome" !!

    Thanks so much... I was thinking very complex!!!


    Regards

    Sandeep

Please sign in to leave a comment.