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: 
surajap123
Creator III
Creator III

expression containing 1- or -1

Hi All,

Just wondering what is -1 or 1- indicate when we do division in the expression.

eg-

1- Sum(Cost)/sum(Sales)

or

column(1)/ column (2) -1

So, in above expressions what is the significance of 1- in first expression and -1 in the second expression?

Thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

For example

1- Sum(Cost)/sum(Sales)


equals


( Sum(Sales) - Sum(Cost) )

/

Sum(Sales)


which could be read as profit percentage (in relation to sales)

View solution in original post

4 Replies
swuehl
MVP
MVP

Division precedes the subtraction, so it's basically

1 - DivisionResult

vs.

DivisionResult -1

Hence both expressions differ in sign.

surajap123
Creator III
Creator III
Author

Thanks Stefan.

Could you tell me why the business want to substract. I mean what is the general use case.

swuehl
MVP
MVP

For example

1- Sum(Cost)/sum(Sales)


equals


( Sum(Sales) - Sum(Cost) )

/

Sum(Sales)


which could be read as profit percentage (in relation to sales)

surajap123
Creator III
Creator III
Author

Thanks