47 Replies Latest reply: Dec 5, 2017 12:48 PM by Anil Babu RSS

    SUM a Value Distinct Orders Today + Yesterday

    Maria Gonzalez

      Hello,

       

      I want to SUM the distict Orders Packeges Today and Yesterday, It already works for today not for yesterday.

       

      Somebody can let me know what is wrong

       

       

      //SUM Distinct Packeges Today------ is good

      SUM(aggr(Sum(distinct{<Date={"$(=Date(max(Date),'DD/MM/YYYY'))"}, _Id_Flag={0},Estatus_Cobranza= {'EN SURTIDO','FACTURADO','ENTREGADO','CONSOLIDADO'}, Liberado={0}, 

             TipoDeEntrega -= {'SOLO FACTURA','NO INVENTARIABLE'},Año={$(vAñoActual)},Mes=,Semana=>}Cant_Cajas),Numero_OrdenVenta))

             

      +

      //SUM Distinct Packeges Yesterday----- is wrong

      SUM(aggr(Sum(distinct{<Date={"$(=Date(max(Date)-1,'DD/MM/YYYY'))"}, _Id_Flag={0},Estatus_Cobranza= {'EN SURTIDO','FACTURADO','ENTREGADO','CONSOLIDADO'}, Liberado={0}, 

             TipoDeEntrega -= {'SOLO FACTURA','NO INVENTARIABLE'},Año={$(vAñoActual)},Mes=,Semana=>}Cant_Cajas),Numero_OrdenVenta))

             

       

      Thank you!