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: 
abc_18
Creator II
Creator II

How to write if condition

Hi,

how to fulfil two condition in same expression.

This is the table attached below.

P1.png

Expression which I am using for Amount LCY with split column is:-


=if(ProformaParent<>'NULL' and Split1=split ,sum(split*total_amount_fct)/100 ,

if(ProformaParent<>'NULL' and Split1<>split ,sum(split*total_amount_fct)/100 )


Requirement is if split1=split then this formula sum(split*total_amount_fct)/100 should apply, otherwise if split1<>split

then sum(split*total_amount_fct)/100 formula should be applicable.


I tried to do that, but at a time only one condition is fulfilling.



1 Solution

Accepted Solutions
Kushal_Chawda

For both the condition expressions is same (sum(split*total_amount_fct)/100)? try below

if(ProformaParent<>'NULL' and (Split1=split or Split1<>split), sum(split*total_amount_fct)/100)

View solution in original post

7 Replies
Kushal_Chawda

For both the condition expressions is same (sum(split*total_amount_fct)/100)? try below

if(ProformaParent<>'NULL' and (Split1=split or Split1<>split), sum(split*total_amount_fct)/100)

Anonymous
Not applicable

SUM(IF(Not(IsNull(ProformaParent)),IF(split1<>split,sum(split1*total_amount_fct)/100,sum(split*total_amount_fct)/100))


Regards

santhosh_k_n
Creator II
Creator II

Hi Shikha,

Please try below,

if(ProformaParent<>NULL() and Split1=split ,sum(split*total_amount_fct)/100 ,

if(ProformaParent<>NULL() and Split1<>split ,sum(split*total_amount_fct)/100 ))


Regards,

SK

Anonymous
Not applicable

Sorry, my last expression is wrong:


SUM(IF(Not(IsNull(ProformaParent)),IF(split1<>split,split1*total_amount_fct/100,split*total_amount_fct/100)))


We put IF conditions into sum expression to calculate the correct result on total rows.


Regards

ankit777
Specialist
Specialist

Hi

try this

if(not isnull(ProformaParent) and Split1=split ,sum(split*total_amount_fct)/100 ,

if(not isnull(ProformaParent) and Split1<>split ,sum(split*total_amount_fct)/100 ))


pooja_sn
Creator
Creator

Why do you need Split1 comparison condition, if you expect to display same expression in both the cases ?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Indeed. The solution to your current post doesn't need two conditions. It can be resolved using this expression:

=IF (NOT IsNull(ProformaParent), Sum(split * total_amount_fct) / 100)


Can you rewrite your OP to make it more clear what you're after? Thanks.


Peter