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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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
MVP
MVP

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