<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Nested if/and expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788800#M1044729</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The formula in Excel reads as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=IF(AND(K4="False",L4="False",P4="True"),"Decrease CL",(IF(AND(K4="False",L4="True",P4="True"),"Increase CL","OK")))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if([N2check equal MP CL]=False(),if([N2check more than MP CL]=False(),if([Actual Trading &amp;gt; MP Cred Lim]=True(),'Decrease CL',if([N2check equal MP CL]=False(),if([N2check more than MP CL]=True(),if([Actual Trading &amp;gt; MP Cred Lim]=True(),'Increase CL','OK'))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(where K = [N2check equal MP CL], L = [N2check more than MP CL] and P = [Actual Trading &amp;gt; MP Cred Lim], just to clarify that I have referenced the right dataset!!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone can help me code this correctly, it'd be much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter Allen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Nov 2014 13:35:56 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-20T13:35:56Z</dc:date>
    <item>
      <title>Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788800#M1044729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The formula in Excel reads as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=IF(AND(K4="False",L4="False",P4="True"),"Decrease CL",(IF(AND(K4="False",L4="True",P4="True"),"Increase CL","OK")))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if([N2check equal MP CL]=False(),if([N2check more than MP CL]=False(),if([Actual Trading &amp;gt; MP Cred Lim]=True(),'Decrease CL',if([N2check equal MP CL]=False(),if([N2check more than MP CL]=True(),if([Actual Trading &amp;gt; MP Cred Lim]=True(),'Increase CL','OK'))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(where K = [N2check equal MP CL], L = [N2check more than MP CL] and P = [Actual Trading &amp;gt; MP Cred Lim], just to clarify that I have referenced the right dataset!!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone can help me code this correctly, it'd be much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter Allen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 13:35:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788800#M1044729</guid>
      <dc:creator />
      <dc:date>2014-11-20T13:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788801#M1044730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter, try:&lt;/P&gt;&lt;P&gt;If(not [N2check equal MP CL] and not [N2check more than MP CL] and [Actual Trading &amp;gt; MP Cred Lim], 'Decrease CL',&lt;/P&gt;&lt;P&gt; If(not [N2check equal MP CL] and [N2check more than MP CL] and [Actual Trading &amp;gt; MP Cred Lim], 'Increase CL', 'OK'))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 13:43:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788801#M1044730</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2014-11-20T13:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788802#M1044731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give this a try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If( K4='False' and L4='False' and P4='True', 'Decrease CL',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(&amp;nbsp; K4='False' and L4='True' and P4='True', 'Increase CL', 'OK' )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;&lt;P&gt;Oscar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 13:43:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788802#M1044731</guid>
      <dc:creator>oscar_ortiz</dc:creator>
      <dc:date>2014-11-20T13:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788803#M1044732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your quick reply however unfortunately it's still not pulling the correct responses; the return I'm getting for every line of data is "OK" which definitely shouldn't be the case. I have a feeling it could just be the grammar/syntax I'm getting wrong. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 13:52:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788803#M1044732</guid>
      <dc:creator />
      <dc:date>2014-11-20T13:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788804#M1044733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, is [N2check equal MP CL] and the other fields having values like 0=false, 1=true?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check attachment and tell me the differences.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 13:58:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788804#M1044733</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2014-11-20T13:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788805#M1044734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oscar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No joy I'm afraid. I replaced the Excel references with the field names and same as with Ruben's suggestion, the only returns I had was "OK", as if that's the over-riding response. I checked my logic again and that definitely shouldn't be the case!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 13:59:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788805#M1044734</guid>
      <dc:creator />
      <dc:date>2014-11-20T13:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788806#M1044735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's definitely the correct logic table! I may have just realised what &lt;EM&gt;might&lt;/EM&gt; be an issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "fields" [N2check equal MP CL] etc are actually made from other expressions. If I can give you a breakdown:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[N2check equal MP CL]&lt;/STRONG&gt; is made from the expression &lt;EM&gt;If([N2 Credit Limit] = [MP Credit Limit],True(),False())&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;[&lt;STRONG&gt;N2check more than MP CL]&lt;/STRONG&gt; is made from the expression &lt;EM&gt;If([N2 Credit Limit] &amp;gt; [MP Credit Limit],True(),False())&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Actual Trading &amp;gt; MP Cred Lim]&lt;/STRONG&gt; is made from the expression &lt;EM&gt;If([Actual Trading] &amp;gt; [MP Credit Limit],True(),False())&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could this be where I'm going wrong? I apologise if I've made a stupid mistake, still a Qlik newbie!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 14:04:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788806#M1044735</guid>
      <dc:creator />
      <dc:date>2014-11-20T14:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788807#M1044738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure when using other expressions as fields, you can 'expand' those fields in the expression like:&lt;/P&gt;&lt;P&gt;If(&lt;EM&gt;[N2 Credit Limit]&amp;lt;&amp;gt;[MP Credit Limit]&lt;/EM&gt; and &lt;EM&gt;[N2 Credit Limit] &amp;lt; [MP Credit Limit]&lt;/EM&gt; and &lt;EM&gt;[Actual Trading] &amp;gt; [MP Credit Limit]&lt;/EM&gt;, 'Decrease CL',&lt;/P&gt;&lt;P&gt; If(&lt;EM&gt;[N2 Credit Limit]&amp;lt;&amp;gt;[MP Credit Limit]&lt;/EM&gt; and &lt;EM&gt;[N2 Credit Limit] &amp;gt; [MP Credit Limit]&lt;/EM&gt; and &lt;EM&gt;[Actual Trading] &amp;gt; [MP Credit Limit]&lt;/EM&gt;, 'Increase CL', 'OK'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you upload a sample? Maybe is an issue with QV having more than one value in one field so it returns null&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 14:10:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788807#M1044738</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2014-11-20T14:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788808#M1044741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It shoudl work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Silly question but did you have K L and P as dimensions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 14:14:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788808#M1044741</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2014-11-20T14:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788809#M1044742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll give it a go with 'expanding' the fields first. Not sure how I'd be able to upload a sample as the data contains sensitive information and I really don't have the time to go through it and create dummy data! Will let you know how I get on but have to move onto a different project for now.&lt;/P&gt;&lt;P&gt;Thanks so much for your advice, I'll certainly be in touch!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 14:18:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788809#M1044742</guid>
      <dc:creator />
      <dc:date>2014-11-20T14:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788810#M1044743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi RJ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 14:20:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788810#M1044743</guid>
      <dc:creator />
      <dc:date>2014-11-20T14:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788811#M1044744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Peter, had to run to a meeting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are the actual values of K, L and P?&amp;nbsp; Are they actual text saying False and True?&amp;nbsp; Or are they logical representations of True and False?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 14:42:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788811#M1044744</guid>
      <dc:creator>oscar_ortiz</dc:creator>
      <dc:date>2014-11-20T14:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788812#M1044745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know. But did you have the field equivalents as dimensions&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 14:43:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788812#M1044745</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2014-11-20T14:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if/and expression</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788813#M1044746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To follow up on previous question.&amp;nbsp; If they are stored in Excel as TRUE and FALSE then you would have to modfiy the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If( K4=0 and L4=0 and P4=1, 'Decrease CL',&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(&amp;nbsp; K4=0 and L4=1 and P4=1, 'Increase CL', 'OK' )&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;QlikView will read the TRUE value as 1 and the FALSE value as 0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 14:56:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-and-expression/m-p/788813#M1044746</guid>
      <dc:creator>oscar_ortiz</dc:creator>
      <dc:date>2014-11-20T14:56:31Z</dc:date>
    </item>
  </channel>
</rss>

