Hi everyone!
I need sum the value per sales order(ORDEM_VENDA) and compare with one value per produtct(CODIGO_ITEM), then give an average of dates, can anyone help me please?
my try:
if(
AGGR ( sum({< STATUS2 = {'FATURADO'}, EMPRESA = {'FISA'}, DEPOSITO = {'A01'}, OC_CLIENTE -= {"*PROG*"} >}
QUANTIDADE), ORDEM_VENDA,CODIGO_ITEM )
<= QTD_MAX_PRAZO,
avg({< STATUS2 = {'FATURADO'}, EMPRESA = {'FISA'}, DEPOSITO = {'A01'}, OC_CLIENTE -= {"*PROG*"}>}
DATA_NFF_FATURA - DATA_CRIACAO_LINHA))
thanks.