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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SUM of positive and negative values in script

Hello

I can't aggregate a cloumn that contains both positive and negative values in the script, it sends an error of expression message.

Does anyone know how to handle this

Thanks in advance for your help

4 Replies
Not applicable
Author

TRY TO WRITE YOUR FIELD  INSIDE NUM() OR TEXT(),

IN WHICH NEGATIVE AND POSITIVE VALUE CONTAIN

example

num(fieldname)

or

text(fieldname)

***********************

LOAD num(test) as test_new, * INLINE [

    test

    1

    -2

    -4

    +6

];

gaurav2017
Creator II
Creator II

Hi,

can u show me the expression, or an example qvw?

Regards,

jjordaan
Partner - Specialist
Partner - Specialist

Meriem,

It is not a directly answer to your question.

The answer to your question is in my opinium given by vishwaranjan.

But if you do a sum of the negative and positive values remember to ask yourself if must absolute values or not.

For this you can use the Fabs function.

Not applicable
Author

Hello everyone,

I'm sorry I found the origin of the error, it is not because of the negative positive values it was because I did not add the ORDER BY  clause to my query in Qlikview, it works now, thanks really so much for your answers.