Input -
Name|city |startyear
Rahul |Mumbai|2010
Rahul|kolkata|2014
Rahul|Delhi|2018
Output should be-
Name|city |startyear|endyear
Rahul |Mumbai|2010|2014
Rahul|kolkata|2014|2018
Rahul|Delhi|2018|9999
Answer / yash
We can use rollup to convert whole data in vector and later use vector data in normalize to assign last column.
rollup: use accumulation function on all columns
NORMALIZE:
length :: 3;
out::normalize(in,index)=
begin
out.name :: in.name[index];
out.city :: in.city[index];
out.startyear :: in.startyear[index];
out.endyear :: if(index==2) 9999 else in.startyear[index+1];
end;
| Is This Answer Correct ? | 0 Yes | 0 No |
Can you read multiple input files using one input file component ? (Same DML) How to use in abinitio graph?
what is the difference between .dbc and .cfg file?
What information does a .dbc file extension provides to connect to the database?
wt is meant by repartioning in howmany ways it can be done.
What is meant header and tailer, suppose header and tailer had some junk data how will delete junk data ? which components r used?
11. What is the use of allocate()?
What is the core of co> operating system?
Hi friends, I have 100 records in my input file, if i run first,the first 10 records are stored into the output and if i run second time next 10 records stored into the output file like that please let me know the answer Thanks, krishna
How will u remove header record? How will u remove tailer record?
What is the difference between rollup and scan?
How you can run a component for certain conditions ?
What is a rollup component? Explain about it.