Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Ronald
Contributor III
Contributor III

Sum numbers and distinct value

Hola requiero su ayuda; tengo una tabla en QS con los siguientes valores; como puedo obtener el total de '60,82' ya que, las dos primeras fila se repiten en valor, pero el campo 'rep' es diferente. Puedo usar la función Distinct de alguna manera para que no me considere el campo 'rep'

qs.png

Result  KPI=60,82

 

Labels (1)
2 Solutions

Accepted Solutions
Wlad_Masi
Employee
Employee

Hi Ronal,

 

you can use sum(distinct field) as you can see in the image below:

sum Distinct.png

In this case you are going to count distinct, but the "duplicate" values is still going to be showed, because they are not duplicated if you consider to entire line of data for example in your case the first and second line are not considered duplicated because you have rep 1 and 2.

 

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.

View solution in original post

Luis_Calvo
Contributor III
Contributor III

Hola Ronald,

Que raro, cargue tu tabla y si que me da el dato. Adjunto imagen.


Imagen1.png

Saludos

 

View solution in original post

10 Replies
Wlad_Masi
Employee
Employee

Hi Ronal,

 

you can use sum(distinct field) as you can see in the image below:

sum Distinct.png

In this case you are going to count distinct, but the "duplicate" values is still going to be showed, because they are not duplicated if you consider to entire line of data for example in your case the first and second line are not considered duplicated because you have rep 1 and 2.

 

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.
Ronald
Contributor III
Contributor III
Author

Thanks for the quick replay; the information is duplicated for rep1 and rep; I must do the distinct for the fields, the table should be as follows, without the rep field:
1001 163 376402 M1 18,43
Wlad_Masi
Employee
Employee

If you have "Rep" added to your table as a column you won't be able to show only one value. As I said you have different rep values for the first and second lines what makes them unique. 

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.
Ronald
Contributor III
Contributor III
Author

Then, I want to show in KPI the value $60,82, is possible with the Distinct function?
Luis_Calvo
Contributor III
Contributor III

Intenta con esto

sum(aggr(max(valor),codigo,prod,art,clase))

Saludos
Ronald
Contributor III
Contributor III
Author

Hola, gracias, pero me sigue saliendo el mismo valor total 😞 y no $60.82
Luis_Calvo
Contributor III
Contributor III

Hola Ronald,

Que raro, cargue tu tabla y si que me da el dato. Adjunto imagen.


Imagen1.png

Saludos

 

Ronald
Contributor III
Contributor III
Author

Vor a probar y te comento, gracias
Ronald
Contributor III
Contributor III
Author

Perfecto muchas gracias, me sirvió tú sugerencia