Employee
Employee

Re: Criando Dada e valores faltantes

Veja se atende

Base:

Load date(Data) as Data, Loja, Produto, Valor Inline

[Data, Loja, Produto, Valor

41821,A,10,10

41822,A,10,20

41823,A,10,30

41824,A,10,40

41825,A,10,50

41826,A,10,50

41827,A,10,50

41828,A,10,50

41829,A,10,50

41830,A,10,50

41831,A,10,50

41832,A,10,50

41833,A,10,50

41834,A,10,50

41835,A,10,50

41836,A,10,50

41837,A,10,50

41838,A,10,50

41839,A,10,50

41840,A,10,50

41841,A,10,50

41842,A,10,50

41843,A,10,

41844,A,10,60

41845,A,10,30

41846,A,10,30

41847,A,10,30

41848,A,10,30

41849,A,10,

41850,A,10,20

41851,A,10,20

41821,B,10,20

41822,B,10,20

41823,B,10,20

41824,B,10,20

41825,B,10,20

41826,B,10,20

41827,B,10,20

41828,B,10,

41830,B,10,

41831,B,10,50

41832,B,10,50

41833,B,10,50

41834,B,10,50

41835,B,10,50

41836,B,10,50

41837,B,10,50

41838,B,10,50

41839,B,10,50

41840,B,10,50

41841,B,10,50

41842,B,10,50

41843,B,10,50

41844,B,10,50

41845,B,10,50

41846,B,10,50

41847,B,10,50

41848,B,10,50

41849,B,10,50

41850,B,10,50

41851,B,10,50

];

Tmp:

noconcatenate LOAD

  Data,

  if(Loja = peek('Loja'),Data - Peek('Data'),0) as Q,

  Loja,

  Produto,

  Valor

Resident Base

order by Loja, Data ;

Tmp2:

noconcatenate LOAD

  Date(Data + IterNo() - Q) as Data,

  Loja,

  Produto,

  //Valor,

  alt(Valor,Peek('Valor')) as Valor

Resident Tmp

While IterNo() <= Q

order by Loja, Data ;

drop table Base;

drop Table Tmp;