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: 
paulyeo11
Master
Master

How to make -125.8% display as +100% ?

Hi All

I have a expression.

(

sum({$<nET_PROFIT={'nET_PROFIT'}, date={">=$(=num(YearStart(Today())))<=$(=num(Today()))"}>} Amount*-1/1000)

-

sum({$<nET_PROFIT={'nET_PROFIT'}, date={">=$(=num(AddYears(YearStart(Today()), -1)))<=$(=num(AddYears(Today(), -1)))"}>} Amount*-1/1000)

)

/

sum({$<nET_PROFIT={'nET_PROFIT'}, date={">=$(=num(AddYears(YearStart(Today()), -1)))<=$(=num(AddYears(Today(), -1)))"}>} Amount*-1/1000)

Now mu issue is when 2015 net profit amount -ve and 2016 net profit amount +ve , it display -ve % , which is wrong , i like to make it display 100%.

Hope some one can advise me.

Paul

7 Replies
paulyeo11
Master
Master
Author

my QVF

sunny_talwar

Why would you see a 100%? Is this in general that any time you have a negative %age, you would want to see 100%?

paulyeo11
Master
Master
Author

Hi Sunny

I miss your reply.

I am think if it is able see +ve % I am

Fine.

As it is not easy to compute to show the actual % growth from -ve to + ve.

Paul

Get Outlook for iOS<https://aka.ms/o0ukef>

vinieme12
Champion III
Champion III

i think you have reused an expression to show amount in $000's that's why dividing by 1000!

but you don't need that for the percentage calculation.


Also if the increase / decrease percentage is -125% or +125% you should show it as it is instead of ceiling to 100%


(

sum({$<nET_PROFIT={'nET_PROFIT'}, date={">=$(=num(YearStart(Today())))<=$(=num(Today()))"}>} Amount)

-

sum({$<nET_PROFIT={'nET_PROFIT'}, date={">=$(=num(AddYears(YearStart(Today()), -1)))<=$(=num(AddYears(Today(), -1)))"}>} Amount)

)

/

sum({$<nET_PROFIT={'nET_PROFIT'}, date={">=$(=num(AddYears(YearStart(Today()), -1)))<=$(=num(AddYears(Today(), -1)))"}>} Amount)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
paulyeo11
Master
Master
Author

Hi Vineeth

Thank you for your sharing.

If you see carefully , the bar chart , shown that profit for 2015 was -ve value , and 2016 was +ve value.

the fact is that logically the % should be +ve , but your expression is still show -ve.

Paul

vinieme12
Champion III
Champion III

Hi Paul,

Recheck your expression for profit, you are multiplying it with -1.

What is the purpose of multiplying profit with -1?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
paulyeo11
Master
Master
Author

Hi Vineeth

You are right , the -ve sign should not be there ,  i think i accidently enter in , which is wrong. after i remove the -ve sign.

Now after remove the -ve sign. but for TDSID , how to make it display +ve % ?

Paul