Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
marygrace
Contributor III
Contributor III

SUM a Value Distinct Orders Today + Yesterday

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!

47 Replies
Anil_Babu_Samineni

May be images helps this case, Because if you put simple Max(Date) in analysis it's working as you said, That means Max(Date)-1 or Max(Date-1) may or may not return Date formats. This is the case it may fails as assumption the rule of set analysis is left part should be same format with calculation in right part of set analysis. I wonder, How this returns in your statement.

finally, We need to test using text box whether how this returns with Date field Format is resemblance to each.

HTH

Anil

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
marygrace
Contributor III
Contributor III
Author

Max(Date).JPG

Anil_Babu_Samineni

Now, Can you cover with Date format like

Date(Max(Date)-1, 'DD/MM/YYYY') // Show me what it returns

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
marygrace
Contributor III
Contributor III
Author

Max(Date)_02.JPG

Anil_Babu_Samineni

Now check this in text box?

SUM(aggr(Sum(distinct{<_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))

And Go and Use filter for "22/11/2017" from Date field whether how it returns in text box, Please show the image

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
marygrace
Contributor III
Contributor III
Author

Max(Date)_03.JPG

Anil_Babu_Samineni

Have you filtered in listbox with "21/11/2017" ??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
marygrace
Contributor III
Contributor III
Author

22/11/2017

marygrace
Contributor III
Contributor III
Author

Max(Date)_04.JPG

Anil_Babu_Samineni

No, do it with "21/11/2017" as it is in list box? then we can assume related the same

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful