Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
DataUltRepo:
LOAD
"nr-ord-produ",
"dat-fim-operac" as dataFim,
Max ("num-operac-sfc") as ultimoReporte
resident [Ord-Prod]
group by "nr-ord-produ"
;
Olá,
Estou usando código acima para gerar uma tabela com os seguintes dados: ordem, data final e ultimo reporte.
Preciso pegar somente a data do maior valor de num-operac-sfc, mas está dando o erro
Existe alguma outra alternativa?
Try this. The Case of nr-ord-produced is different in the Group By
DataUltRepo:
LOAD
"nr-ord-produced",
"give-um-Operace" as dataFim,
Max ( "num-Operace-c") as ultimoReporte
residence [Ord-Prod]
group by "nr-ord-produced"
;
You need to add both the fields("nr-ord-produ" and "dat-fim-operac" )in group by clause like this
LOAD
"nr-ord-produ",
"dat-fim-operac" como dataFim,
Max ("num-operac-sfc") como ultimoReporte
residente [Ord-Prod]
grupo por "nr-ord-produ", "dat-fim-operac";
Please mark the answer right if it solves your problem.
Resolve o erro, mas traz mais de um "nr-ord-produ" igual
This is because for one "nr-ord-produ" there are two dates(dataFim). If you only wants the second row from '332611' irrespective of dates. Go for this script-
LOAD
"nr-ord-produ",
// "dat-fim-operac" como dataFim, -- Commented to bring the max value irrespective of date
Max ("num-operac-sfc") como ultimoReporte
residente [Ord-Prod]
grupo por "nr-ord-produ";
Please mark the answer right if it solves your problem.
Mas preciso do "dat-fim-operac"