Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested if/and expression

Hi all,

Really hope someone can help me with this one. I've created a formula in Excel which I'm trying to replicate as an expression in Qlik. The formula in Excel reads as:

=IF(AND(K4="False",L4="False",P4="True"),"Decrease CL",(IF(AND(K4="False",L4="True",P4="True"),"Increase CL","OK")))

Which reads and works fantastically. The closest I've been able to come with an expression within Qlik (which still doesn't return the correct results) is:

if([N2check equal MP CL]=False(),if([N2check more than MP CL]=False(),if([Actual Trading > MP Cred Lim]=True(),'Decrease CL',if([N2check equal MP CL]=False(),if([N2check more than MP CL]=True(),if([Actual Trading > MP Cred Lim]=True(),'Increase CL','OK'))))))

(where K = [N2check equal MP CL], L = [N2check more than MP CL] and P = [Actual Trading > MP Cred Lim], just to clarify that I have referenced the right dataset!!)

If anyone can help me code this correctly, it'd be much appreciated!

Kind regards,

Peter Allen

13 Replies
Not applicable
Author

Hi RJ,

No, K, L and P are Excel references. I included the Excel formula so you can see what the result I'm trying to get in Qlik is. If you check out my responses to Ruben I explain a bit more about how I created each respective field.

Thanks,

Peter

oscar_ortiz
Partner - Specialist
Partner - Specialist

Sorry Peter, had to run to a meeting.

What are the actual values of K, L and P?  Are they actual text saying False and True?  Or are they logical representations of True and False?

robert99
Specialist III
Specialist III

I know. But did you have the field equivalents as dimensions

oscar_ortiz
Partner - Specialist
Partner - Specialist

To follow up on previous question.  If they are stored in Excel as TRUE and FALSE then you would have to modfiy the script:

If( K4=0 and L4=0 and P4=1, 'Decrease CL',

     If(  K4=0 and L4=1 and P4=1, 'Increase CL', 'OK' )

)

QlikView will read the TRUE value as 1 and the FALSE value as 0.