<?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 in Set Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1567615#M742812</link>
    <description>&lt;P&gt;Would you be able to provide a sample where you are trying this?&lt;/P&gt;</description>
    <pubDate>Wed, 10 Apr 2019 12:21:04 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2019-04-10T12:21:04Z</dc:date>
    <item>
      <title>IF statement in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1567602#M742809</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is it possible to use IF statements in Set Variables?&lt;/P&gt;&lt;P&gt;If would like to do the following:&lt;/P&gt;&lt;P&gt;vSetExcludeItems:&lt;/P&gt;&lt;P&gt;If (year&amp;gt;=2018, ProductCode-={'44636'}, ProductCode-={'46488'})&lt;/P&gt;&lt;P&gt;But it doesnt work, so am I write it in the wrong way or is it not possible to do like this?&lt;/P&gt;&lt;P&gt;So I want to be able to use the vSetExcludeItems in charts and tables in a set expression, so that I do not have to do an if statement in all chart objects.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:04:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1567602#M742809</guid>
      <dc:creator>Qlik_vic</dc:creator>
      <dc:date>2024-11-16T21:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1567607#M742810</link>
      <description>&lt;P&gt;This won't work like this, but may be something like this&lt;/P&gt;&lt;PRE&gt;{&amp;lt;year *= {"&amp;gt;=2018"}, ProductCode -= {'44636'}&amp;gt;+&amp;lt;year *= {"&amp;lt;2018"}, ProductCode -= {'46488'}&amp;gt;}&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Apr 2019 12:07:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1567607#M742810</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-10T12:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1567612#M742811</link>
      <description>&lt;P&gt;Unfortunately that didnt work either&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 12:13:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1567612#M742811</guid>
      <dc:creator>Qlik_vic</dc:creator>
      <dc:date>2019-04-10T12:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1567615#M742812</link>
      <description>&lt;P&gt;Would you be able to provide a sample where you are trying this?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 12:21:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1567615#M742812</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-10T12:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1567885#M742814</link>
      <description>Try making a flag in the script:&lt;BR /&gt;if( year &amp;gt;= 2018,  if(ProductCode = '44636', 0,1), if(ProductCode = '46488', 0,1)) as Product_Flag&lt;BR /&gt;Then in your set analysis you could use {&amp;lt;Product_Flag = {1}&amp;gt;}</description>
      <pubDate>Wed, 10 Apr 2019 21:43:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1567885#M742814</guid>
      <dc:creator>David_Capan</dc:creator>
      <dc:date>2019-04-10T21:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1568256#M742815</link>
      <description>&lt;P&gt;The fields are in separate tables, how should I do when the year comes from the common calendar and the product from product table?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 14:28:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1568256#M742815</guid>
      <dc:creator>Qlik_vic</dc:creator>
      <dc:date>2019-04-11T14:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1568261#M742816</link>
      <description>&lt;P&gt;The lookup function may work&lt;BR /&gt;if(Lookup('year','Date_Key',Date_Key,'CalendarTable') &amp;gt;= 2018, if(ProductCode = '44636', 0,1), if(ProductCode = '46488', 0,1)) as Product_Flag&lt;BR /&gt;Then in your set analysis you could use {&amp;lt;Product_Flag = {1}&amp;gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note:&amp;nbsp; You may have to perform a RESIDENT load to do this, assuming you're loading the calendar at the end of the script, as you can only look up values that have already been loaded.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 14:45:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1568261#M742816</guid>
      <dc:creator>David_Capan</dc:creator>
      <dc:date>2019-04-11T14:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1568530#M742817</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I cannot get it to work or then I just end up with loops in the tables. I can just make the flags in separate tables so I have one product flag and one year flag then of course I can make an union in the set expression, but then the problem is there are charts that need to have set variables as well in the expressions. Is there any way to combine more than two flags or flags and set variables?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 05:41:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1568530#M742817</guid>
      <dc:creator>Qlik_vic</dc:creator>
      <dc:date>2019-04-12T05:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1568536#M742818</link>
      <description>how did you implement sunny's solutions . I think it should work.&lt;BR /&gt;&lt;BR /&gt;1(using sunny solution):&lt;BR /&gt;Sum({&amp;lt;year = {"&amp;gt;=2018"}, ProductCode -= {'44636'}&amp;gt;+&amp;lt;year *= {"&amp;lt;2018"}, ProductCode -= {'46488'}&amp;gt;}Sales)&lt;BR /&gt;&lt;BR /&gt;2:If (year&amp;gt;=2018,Sum({&amp;lt;ProductCode-={'44636'}&amp;gt;}Sales), Sum({&amp;lt;ProductCode-={'46488'}&amp;gt;}Sales))</description>
      <pubDate>Fri, 12 Apr 2019 05:52:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1568536#M742818</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2019-04-12T05:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1569174#M742819</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The solution Sunny provided gives the correct result for 2018, but for 2017 it shows both products.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 07:00:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1569174#M742819</guid>
      <dc:creator>Qlik_vic</dc:creator>
      <dc:date>2019-04-15T07:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement in Set Expression</title>
      <link>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1569351#M742820</link>
      <description>&lt;P&gt;Would you be able to share a sample where we can see the issue for 2017?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 11:28:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-statement-in-Set-Expression/m-p/1569351#M742820</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-15T11:28:51Z</dc:date>
    </item>
  </channel>
</rss>

