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: 
lidiacuna
Contributor II
Contributor II

Display positive value from database as negative in Qlik Sense

Hi!

I'm making a sales report in Qlik Sense, and we need to display our clients' rewards as negative values so they can be subtracted from the value of their invoices. The problem is that in our database, the value of the rewards are displayed as positive numbers.

For example: 

rociomendez_1-1614361189940.png

The value highlighted in yellow needs to be negative, for the sum of those sales to be 200,641.61 instead of 201,039.89, as it is displayed in the first value of the table.

Any ideas?? 

Labels (2)
1 Solution

Accepted Solutions
QFabian
MVP
MVP

Hi @lidiacuna ,you can do something like this: 

In Script :

Load

field1,

field2,

Concepto,

if(Concepto = 'BONIFICACION', Monto*-1, Monto) as Monto

FROM YourSource;

 

In Expression :

sum(if(Concepto = 'BONIFICACION', Monto*-1, Monto))

Avísame si es una solución a tu pregunta!

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.

View solution in original post

2 Replies
QFabian
MVP
MVP

Hi @lidiacuna ,you can do something like this: 

In Script :

Load

field1,

field2,

Concepto,

if(Concepto = 'BONIFICACION', Monto*-1, Monto) as Monto

FROM YourSource;

 

In Expression :

sum(if(Concepto = 'BONIFICACION', Monto*-1, Monto))

Avísame si es una solución a tu pregunta!

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
lidiacuna
Contributor II
Contributor II
Author

Sí! funcionó perfectamente. Muchas gracias, Fabián 🙂