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

Announcements
Register by January 31 for $300 off your Qlik Connect pass: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Assign negative values to variable values

Hello,

i have a very simple question, in which i wasn't able to find a solution from google.

Here is the sample of my table:

Item

Quantity

Price

I just want to make all Quantity values negative. I tried Quantity*(-1) but it didn't work. Can anyone please suggest a way to acomplish that?

Thank you in advance

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Try this

num#(Quantity,'#')*-1 as Quantity

View solution in original post

4 Replies
swuehl
Champion III
Champion III

This should work if you are using this as calculated field in the LOAD script or a UI expression.

Also, your Quantity values should be numeric, not just pure text values.

Anonymous
Not applicable
Author

It should work.. Can you post your variable expression !!

Anonymous
Not applicable
Author

Try this

num#(Quantity,'#')*-1 as Quantity

Not applicable
Author

It worked finally! Thanks for your suggestions