Abinitio Interview Question 43
Abinitio Interview Question 43
cust_id, card_type
111, platinum
111, gold
111, silver
222, ruby
222, gold
222, platinum
222, diamond
333, iron
333, copper
333, gold
Find out the customer
who has all 3 - diamond,platinum and gold called premium customer.
constant string1 =diamond
constant string2 =platinum
constant string3 =gold
//let string(20)[3] my_vec=[vector 'diamond','platinum','gold'];
type temporary_type=
begin
decimal("") cnt;
string(",") ctypes;
end;
out::initialize(in)=
begin
temp.cnt::0;
end;
out::rollup(temp,in)=
begin
temp.cnt::if(in.card_type member [vector 'diamond','platinum','gold']) temp.cnt+1 else temp.cnt;
temp.ctypes::string_concat(temp.ctypes,in.card_type);
end;
out::finalize(temp,in)=
begin
out.cnt::temp.cnt;
out.cust_id::in.cust_id;
out.card_types::temp.ctypes;
end;
out::output_select(out)=
begin
out::if(out.cnt==3);
end
For More Abinitio, AWS, Database content please visit my youTube channel.
https://www.youtube.com/@datapundit
@datapundit
Comments
Post a Comment