Posts

Showing posts with the label Count

S) Ball & run Scenario | Type 2

Image
      Input data       over run   1 6   2 5   3 13           Rollup    Use key change function   type temporary_type =   record   decimal("\n ") run _per_over ;   end;   out:: key_change (in 1,in 2)=   begin   out:: if(( decimal( "|" ))in2.ball %6==1)1 else 0;   end;   temp:: initialize(in)=   begin   temp.run_per_ over : :0;   end;   temp ::rollup ( temp,in )=   begin   temp.run_per_ over :: temp.run _per_over +( decimal( "|")) in.run ;   end;   out : : finalize( temp, in) =   begin   out.over ::( decimal("|")) next_in_sequence ();   out.run :: temp.run _per_over ;   end;      

S) Ball & run Scenario using rollup -- Type 1

Image
  Input data         o/p   ball run   1 6   2 5   3 5         Rollup   Use key change function