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

How to implement in expression ?

How to write the condition :

If negative value then Sum(projected_adjustment)

If positive value the 0

RISK = Sum(projected_adjustment) is an expression in qlikview model

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

As before:

RangeMin(0, $(vRisks)-$(vUnit))

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

6 Replies
simondachstr
Specialist III
Specialist III

I would suggest using set analysis

sum({<projected_adjustment={'<0'}>} projected_adjustment)

Not applicable

Hi


sum({<projected_adjustment={">0"}>} projected_adjustment)


This will return only Neg values.


sum({<projected_adjustment={"<0"}>} projected_adjustment)


This will return only Pos values.



simondachstr
Specialist III
Specialist III


It's actually the other way around.. and don't use " but ', because otherwise it will compare the string "<0" rather than the numeric range <0.

suvechha_b
Creator III
Creator III
Author

Can you please do the calculation with the following expression :

=$(vRisks)-$(vUnit)

Thanks in Advance

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

To avoid calculating the expression twice, use RangeMin, like this:

RangeMin(0, Sum(projected_adjustment))


This will return 0 for positive numbers and the value for negative values.


Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

As before:

RangeMin(0, $(vRisks)-$(vUnit))

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein