GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Data Warehousing  >  Abinitio

 Print  |  
Question:  Cummulative summary in AB Initio

Answer: How can I achieve cummulative sumary in AB Initio other than using SCAN component. Is there any inbuilt function available for that?


July 07, 2008 09:59:00 #1
 robmuza   Member Since: July 2008    Total Comments: 2 

RE: Cummulative summary in AB Initio
 

Scan is really the most simple way to achieve this.  Another way is to use a ROLLUP, since it is a multistage component.  You need to put the ROLLUP component into multistage format and write the intermediate results to a temp array (I think they're called vectors in AI).  The ROLLUP loops through each record in your defined group.

Let's say you want to get intermediate results by date.  You sort your data by {ID; DATE} first.  Then ROLLUP by {ID}.  The ROLLUP will execute it's transformation for each record per ID.  So store your results in a temp vector, which will need to be initialized to be the size of your largest group.  Each time the ROLLUP enters the tranformation, write to the [i] position in the array and increment i each time.  As long as this is all done in the "rollup" transformation and not the "finalize" transformation, it will run the "initialize" portion before it moves to the next ID.

I have done it this way, but the Scan is easier.  I was doing a more simple rollup before I found that I needed cumulative intermediate results, so I just modified my existing ROLLUP.  Ab Initio documentation does not explain this technique in detail, but it can be done.  Let me know if you need more detail and I can provide a better example.
     

 

Back To Question