Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
MarioCenteno
Creator III
Creator III

Sales values zero current Month

Good afternoon, I need you to help me solve this problem:


I need to show only sales with zero value of the current month and then compare it with the sales average of the last 3 months.


2018-07-25 15_43_08-Qlik Sense Desktop.png

Labels (3)
5 Replies
BalaBhaskar_Qlik

Think so,

Current month Sales with zero value

Sum({$<Sales = {'0'}, Month={'$(=Month(max(Date)))'}>}[Sales])

Previous 3 months sales:

=Sum({<Sales = {'0'}, Date={">=$(=MonthStart(AddMonths(Max(Date),-3)))<=$(=MonthEnd(AddMonths(Max(Date),-1)))"}>}Sales)

MarioCenteno
Creator III
Creator III
Author

Thanks for answering he resolved the current month and last 3 months, now the problem is that I have to put myself in the dimension of the same condition and that I show the clients with zero sales I am using a function but something I am doing wrong.

Current month ---> ok

SUM({$<[SALES]=0,[FECHA_PROCESO.autoCalendar.Date]=

{'>=$(=AddMonths(Today(),-1))<=$(=AddMonths(Today(),+1))'}>}SALES)

Previous 3 month sales ---> ok

SUM({$<[FECHA_PROCESO.autoCalendar.Date]=

{'>=$(=AddMonths(Today(),-4))<=$(=AddMonths(Today(),-1))'}>}SALES/3)

Dimension --- not working

=if( aggr((SUM({$<[SALES]=0,[FECHA_PROCESO.autoCalendar.Date]=

{'>=$(=AddMonths(Today(),-1))<=$(=AddMonths(Today(),+1))'}>}SALES)),NOMBRE_CLIENTE)=0, NOMBRE_CLIENTE,'Otros Clientes')

2018-07-26 22_39_17-Qlik Sense Desktop.png

BalaBhaskar_Qlik

You created your expression like this, Your setting the Aggr value with zero, may be that is causing the issue.

=If(Aggr(Sum({<Sales=,Date=>}),Nombre_Cliente)=0,Nombre_cliente,'Otros Clientes')

Try to change your expression like these....

=If(Count(Aggr(Sum({<Sales=,Date=>}),Nombre_Cliente))=0,Nombre_cliente,'Otros Clientes')

Or

=If(Min(Aggr(Sum({<Sales=,Date=>}),Nombre_Cliente))=0,Nombre_cliente,'Otros Clientes')

Or

=If(Avg(Aggr(Sum({<Sales=,Date=>}),Nombre_Cliente))=0,Nombre_cliente,'Otros Clientes')

MarioCenteno
Creator III
Creator III
Author

Not working

pablolabbe
Partner Ambassador
Partner Ambassador

Try this way with the if inside the aggr

=aggr(

   IF( SUM({$<[SALES]=0,[FECHA_PROCESO.autoCalendar.Date]=

   {'>=$(=AddMonths(Today(),-1))<=$(=AddMonths(Today(),+1))'}>}SALES)) = 0, NOMBRE_CLIENTE,'Otros Clientes')

  ,NOMBRE_CLIENTE)

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button! | Follow me on Linkedin