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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
elenarelinque
Creator
Creator

Set analysis

Buenas,

Tengo un indicador para calcular los clientes con ventas en el año actual y me funciona perfectamente:

Count({<[Ventas Actual] = {">0"} >} DISTINCT Cod_Cliente)

Ahora intento calcular los clientes nuevos (creados hace menos de 90 días) con ventas en el año actual, pero me incluye los que tienen ventas 0. He probado dos expresiones pero no funcionan:

Count({<[Ventas Actual] = {">0"},fecha_alta_cli_formato={">=$(vAhora)"}>} DISTINCT Cod_Cliente)

count(distinct {$<fecha_alta_cli_formato={">=$(vAhora)"},[Ventas Actual] = {">0"}>} Cod_Cliente)

 

Gracias de antemano.

Un saludo.

 

 

 

3 Replies
agigliotti
Partner - Champion
Partner - Champion

Hi @elenarelinque ,

Below some questions:

What is the data format of fecha_alta_cli_formato field ?

What is the value of vAhora variable ?

Is Ventas Actual field the sales amount ?

Finally what is the actual result and the expected result?

 

elenarelinque
Creator
Creator
Author

Hi, thanks for your help!

What is the data format of fecha_alta_cli_formato field ?

The format should be ok because the expression is working regarding the date condition, however, this is the format:

elenarelinque_0-1662547168470.png

What is the value of vAhora variable ?

=max(Date(FECHA_ALB-90,'DD/MM/YYYY'))

Also working in another KPI

 

Is Ventas Actual field the sales amount ?

Yes

Finally what is the actual result and the expected result?

 

elenarelinque_1-1662547471210.png

The result is 2, but it should be one because one of the two new client doesn't have sales.

 

The thing is that I have a KPI for the new clients (count(distinct {$<fecha_alta_cli_formato={">=$(vAhora)"}>} Cod_Cliente))and another one for the clients with sales in the actual year (Count({<[Ventas Actual] = {">0"} >} DISTINCT Cod_Cliente)), but when I use the expression with the two conditions it doesn't work.

Count({<[Ventas Actual] = {">0"},fecha_alta_cli_formato={">=$(vAhora)"}>} DISTINCT Cod_Cliente)

 

agigliotti
Partner - Champion
Partner - Champion

Let's try with the below expression:

Count( {< Cod_Cliente = {"=Sum([Ventas Actual])>0"}, fecha_alta_cli_formato = {">=$(vAhora)"} >} DISTINCT Cod_Cliente )

I hope it can helps.

Best Regards