Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Jsobrinho77
Creator
Creator

show only positive values (rows) in straight table

Hi guys,

I have a straight table and I would like to show only positive values on my table.

Dimension, Value

A, sum(fieldX * fieldY)/fieldY) = 5

B,sum(fieldX * fieldY)/fieldY) = -2

C,sum(fieldX * fieldY)/fieldY) =0

I would like to show only lines with dimensions A and C.

How can I do this logic in my expression?

Tks

 

Labels (4)
4 Replies
MarcoWedel

Can you please post your actual expression as there is a bracket missing in the expression you posted.

thanks

Jsobrinho77
Creator
Creator
Author

First of all, thank you for your answer..

The expression is just example, but is:

sum(fieldX * fieldY)/sum(fieldY)

MarcoWedel

maybe this works?

If(sum(fieldX * fieldY)/sum(fieldY)>=0, sum(fieldX * fieldY)/sum(fieldY))

luiferva
Contributor III
Contributor III

Jsobrinho77  Para sacar los valores positivos utiliza la función numerica Sign que retorna  1 si es un valor positivo, -1 si es negativo y a partir de alli utilizar un condicional que te diga cuales son = 1

Por ejemplo

Cargar con los siguientes datos

luiferva_2-1655692035778.png

La letra 'A' al hacer la operación me retornara -4000, por lo tanto con la funcion sign esto es = -1 

Script

luiferva_3-1655692263079.png

 

Resultado

luiferva_4-1655692300249.png

Espero haberte ayudado.