Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Showing a certain value if condition is met

What I am trying to show is the percentage of fees not paid by dividing two fields,  TotalOutstanding (A) and TotalPaid (A). In some cases A is greater than B so the rate is > 100.

What I want is, if the amount is greater than 100, show 100%, else show the calculated amount

This is what i have so far

if( 

(Sum (TOTALOUTSTANDING)/Sum (TOTALPAID)*100 >= '100')

, '100%',

SUM(TOTALOUTSTANDING)/Sum (TOTALPAID)*100

)

1 Solution

Accepted Solutions
prieper
Master II
Master II

see attached

Peter

View solution in original post

11 Replies
prieper
Master II
Master II

Would use formatting in percent, thus 100% = 1. Formula may then look:

if( 

(Sum (TOTALOUTSTANDING)/Sum (TOTALPAID) >= 1)

, 1,

SUM(TOTALOUTSTANDING)/Sum (TOTALPAID)

)

HTH Peter

Not applicable
Author

This is what I have under the numbers tab

num.png

prieper
Master II
Master II

seem to be ok

and ...

does it work?

Not applicable
Author

it does not

vishsaggi
Champion III
Champion III

May be Try like:

if(

    Num(Sum (TOTALOUTSTANDING)/Sum (TOTALPAID) , '###0') >= '100' )

     , '100' &'%',

     Num(SUM(TOTALOUTSTANDING)/Sum (TOTALPAID) , '#,##0%')

)

Can you share a sample if still have issues?

Not applicable
Author

It says Error in Expression

prieper
Master II
Master II

see attached

Peter

Not applicable
Author

I dont know why it isnt working for me

prieper
Master II
Master II

then please check the fieldnames, formula in your application same as sent to you ....

Are your fields numeric fields?

Peter