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

If conditions

Hi All,

I have a table as below.

 

NameTypeAmountGain%
AAAAddress1 b
BBBaddress2
CAAaddress3

I need to write a condition for Gain % in a Straight Table (Expression).

pls find the excel condition given below. I need to write the below expression in Qlikview.

b = IF ( OR(address1= "", sum(address1:address3)=0),"", (address1*100)/(address1:address3)

Can anyone help me with this ?

Thanks,

Praveen

1 Solution

Accepted Solutions
jpenuliar
Partner - Specialist III
Partner - Specialist III

formula would look like:

=if(sum(Amount)=0 or sum(total Amount)=0,'',(Amount)/sum(total Amount))

View solution in original post

13 Replies
alkesh_sharma
Creator III
Creator III

please share what you want or the logic. Addess1 cannot be added to address2 as mentioned in the Excel expression as these are alpha numric.

More over, The excel formula is not write it has errors!

jpenuliar
Partner - Specialist III
Partner - Specialist III

in simple mathematics, what is the formula of Gain% ?

Not applicable
Author

NameTypePremiumGain%
AAA1000
BBB
CAA1500
Totals

I guess this can help you people to understand my question.  Actually the column "Premium" may have empty cells also, So If the cell is empty or The total Premium is null, then it should return "Null" or 0.  Or it should display a values by calculating  Gain %.

jpenuliar
Partner - Specialist III
Partner - Specialist III

So based on your listed columns ( Name,Type,Premium) how do you compute for Gain%?

pradnyat
Creator
Creator

Please find the sample attached file.

Hope this will solve your problem.

jpenuliar
Partner - Specialist III
Partner - Specialist III

formula would look like:

=if(sum(Amount)=0 or sum(total Amount)=0,'',(Amount)/sum(total Amount))

Not applicable
Author

Exactly Jonathan. You got it Ryt. The interpretation is ryt.

But how can I write it in Qlikview. I dont have a column or a value for Total Amount.

Not applicable
Author

Sorry Pradnya, I couldnt open your file.

pradnyat
Creator
Creator

Okay.

You can use below expression for Gain %:

=if(sum(Amount)=0 or sum(total Amount)=0,'',(Amount)/sum(total Amount))