Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problem adds negative values

Hi, I'm new to Qlik. I have the following problem. I have a table with movements, some movements are positive and others negative. I need a totalizer for which I have a simple expression. sum (cantUM1). The problem is that I do not subtract the movements in negative. That is, is not taking the negative sign, how should I fix it?

5 Replies
m_woolf
Master II
Master II

what you are doing should work.Can you show a sample of your data?

Anonymous
Not applicable
Author

Captura.PNG

his is a table in SQL, in this example they entered 411 units and came out 68.79. On my board solves me 411 + 68.79 + 231 + 2 +1, etc

veidlburkhard
Creator III
Creator III

Hi Frederico,

not sure I understand your problem, but if you want to ignore the negative values, you can use this expression:

sum (fabs(cantUM1)).

Fabs just gives you the absolute value!


Regards


Burkhard

Anonymous
Not applicable
Author

My problem is that you are not subtracting the negative values. I add all the values, I need to subtract the negative ones. What expression should I use? Thank you!!

veidlburkhard
Creator III
Creator III

Hi Frederico,

this is exactly what the expression sum (fabs(cantUM1)) does. It adds the positive ones and subtracts the negative ones.

Why don't you try?


Regards

Burkhard