Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

cancel
Showing results for 
Search instead for 
Did you mean: 
maxicarena
Creator
Creator

HELP! How to do a function that contains Count, Sum, two distinct fields

Hello dear, I am wanting to build a KPI to count (count) Documents (Field DOC_CLI) Limited (distinct) when the sum of other Campo (Field VALO) is greater than zero 0.

How do I get the function adding the KPI tell me these SPDs when the sum of VALO is greater than zero?

FIELD = DOC-CLI

FIELD = VALO (contains numbers)

Hola estimados, estoy queriendo armar una KPI que cuente (count) de Documentos (DOC_CLI) Únicos (distinct) cuando la suma de otro Campo (VALO) sea mayor que Cero 0.



¿Cómo hago para que agregando en la Función de la KPI me cuente estos Documentos Únicos cuando la suma de VALO sea mayor a Cero?



CAMPO= DOC-CLI

CAMPO= VALO (contiene números)

1 Solution

Accepted Solutions
sunny_talwar

If you want to see this in a straight table you can use DOC_CLI as your dimension and If(Sum(VALO) > 0, Sum(VALO)) as your expression.

On the other hand, if you wish to see this in a text box object, you can try this

Concat(DISTINCT Aggr(If(Sum(VALO) > 0, DOC_CLI), DOC_CLI), Chr(10))

The above will show a list of DOC_CLI (on a new row) where Sum(VALO) > 0

View solution in original post

5 Replies
sunny_talwar

I am not really sure I follow your request. Would you be able to guide us by sharing few lines of sample data and expected output?

maxicarena
Creator
Creator
Author

Hi Sunny T!, thanks for your interest,here you step in detail what I want to do, ask me to make it clearer if I still do not understand well

Captura.PNG

sunny_talwar

If you want to see this in a straight table you can use DOC_CLI as your dimension and If(Sum(VALO) > 0, Sum(VALO)) as your expression.

On the other hand, if you wish to see this in a text box object, you can try this

Concat(DISTINCT Aggr(If(Sum(VALO) > 0, DOC_CLI), DOC_CLI), Chr(10))

The above will show a list of DOC_CLI (on a new row) where Sum(VALO) > 0

maxicarena
Creator
Creator
Author

Sunny, I do not want a list, I want you to show me the result of the unique DOC_CLI that meet that condition, as KPI, do you understand ?, to work with KPI can not add dimensions, only fields with measures.

I think it must have to be close to the if function, I do not know

maxicarena
Creator
Creator
Author

Sunny, I can solve as follows: Count (DISTINCT Aggr (If (Sum (VALO)> 0, DOC_CLI), DOC_CLI))

Modifying a little your last choice I made it.

Thank you very much Sunny