Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
Try adding your set expression also to the outer aggregation function (first SUM)
Because, We need to degrade with the outer aggregation as well like filters as below
Sum({<[Fecha Liberado CyC]={'$(=Date(max([Fecha Liberado CyC])-1,'DD/MM/YYYY'))'},
Estatus_Cobranza= {'EN SURTIDO','FACTURADO','ENTREGADO','CONSOLIDADO'}, Liberado={0},
TipoDeEntrega -= {'SOLO FACTURA','NO INVENTARIABLE'}>}
Aggr(Sum(distinct{<[Fecha Liberado CyC]={'$(=Date(max([Fecha Liberado CyC])-1,'DD/MM/YYYY'))'},
Estatus_Cobranza= {'EN SURTIDO','FACTURADO','ENTREGADO','CONSOLIDADO'}, Liberado={0},
TipoDeEntrega -= {'SOLO FACTURA','NO INVENTARIABLE'}>}Cant_Cajas), Numero_Entrega))
I've told u this how I proceeded when I got such a problem.. adding the set expression to the outer aggregation function:
I though the same, But fortunately this won't help for him
It works,
I appreciate your help
This finalyy worked !
Yes, it works
Thank you Omar I did not got it very welll your previous post.
Great, It worked for you. But Using outer aggregation of analysis needed very rare case where we are doing with same expression.
So, You can mark helpful also for other answer response which feels better ...