<?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 Re: If Statement with logic in field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-Statement-with-logic-in-field/m-p/134155#M20124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks Tamil -&amp;nbsp; that works brilliantly!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Jul 2018 21:57:45 GMT</pubDate>
    <dc:creator>william_ericksson</dc:creator>
    <dc:date>2018-07-12T21:57:45Z</dc:date>
    <item>
      <title>If Statement with logic in field</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-logic-in-field/m-p/134152#M20121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Hi All&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I am trying to make a Chart If Statement work using a field to inject the logic.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Here are my test data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;LOAD * INLINE &lt;/SPAN&gt;[&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Value, Dimension&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;1, Cars&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;3, Bikes&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Logic:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Dimension, Logic, Target_Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Cars, Value &amp;lt; Target_Value, 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Bikes, Value &amp;gt; Target_Value, 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;In my chart, I have used the following test If statement:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;if($(=Logic), 1,0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;The challenge I have is that my formula works when one of the dimensions is selected (eg Cars or Bikes):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;IMG alt="IfStatement02.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/207650_IfStatement02.PNG" style="height: 504px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;But it does not work in the default state with no selections. It only returns the dash '-' see below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;IMG alt="IfStatement03.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/207651_IfStatement03.PNG" style="height: 509px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Does anyone have a way to make this scenario work so that the logic works when no selections are made? File attached...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Will&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2018 05:18:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-logic-in-field/m-p/134152#M20121</guid>
      <dc:creator>william_ericksson</dc:creator>
      <dc:date>2018-07-12T05:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement with logic in field</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-logic-in-field/m-p/134153#M20122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a variable vTest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture1.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/207657_Capture1.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the expression $(vTest) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will get your output.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/207656_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Uj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2018 05:26:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-logic-in-field/m-p/134153#M20122</guid>
      <dc:creator>ujjwalraja</dc:creator>
      <dc:date>2018-07-12T05:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement with logic in field</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-logic-in-field/m-p/134154#M20123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi William,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the attached file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;If(Pick(Match(Logic,$(=Concat(Chr(39)&amp;amp; Logic &amp;amp; Chr(39), ','))),$(=Concat(Logic,','))),1,0)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="207652" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/207652_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2018 06:00:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-logic-in-field/m-p/134154#M20123</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2018-07-12T06:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement with logic in field</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-logic-in-field/m-p/134155#M20124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks Tamil -&amp;nbsp; that works brilliantly!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2018 21:57:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-logic-in-field/m-p/134155#M20124</guid>
      <dc:creator>william_ericksson</dc:creator>
      <dc:date>2018-07-12T21:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement with logic in field</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-with-logic-in-field/m-p/134156#M20125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Uj - I like that idea. However, I want to keep the Logic field within the table for now. See Tamil's solution below.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2018 21:58:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-with-logic-in-field/m-p/134156#M20125</guid>
      <dc:creator>william_ericksson</dc:creator>
      <dc:date>2018-07-12T21:58:56Z</dc:date>
    </item>
  </channel>
</rss>

