<?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 How can I write a If statement as Set Analysis? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-can-I-write-a-If-statement-as-Set-Analysis/m-p/201734#M501785</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The user requirement is to show the static result, discard ALL the user selection.&lt;/P&gt;&lt;P&gt;The filter Year, Month and Date refers to customer trade date. If user select any filter like Year and Month, then the result will be only a subset and show the inactive customer who has traded on the selected date. It is not meaningful.&lt;/P&gt;&lt;P&gt;If the filter Year, Month and Date refers to customer last trade date, then it will be meaningful. However it is not.&lt;/P&gt;&lt;P&gt;So, that's why the user request to show a static result , ignore the selection from the Year, Month and Date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Nov 2010 11:21:10 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-11-25T11:21:10Z</dc:date>
    <item>
      <title>How can I write a If statement as Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-write-a-If-statement-as-Set-Analysis/m-p/201731#M501782</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;I have a straight table chart which show inactive customer who do not have any trading activities in the past 6 weeks.&lt;/P&gt;&lt;P&gt;The dimension is customer and two expression showing the last trading date and number of trades outstanding.&lt;/P&gt;&lt;P&gt;On the report, I have a Year and Month list box for filtering. However, I want the straight table to show the same output regardless of what Year or Month I have chosen. I know this can be achieved by using 'Set Analysis' with keyword &lt;STRONG&gt;1&lt;/STRONG&gt; instead of $ sign.&lt;/P&gt;&lt;P&gt;My problem here is I fail to convert the if statement into a 'Set Analysis' statement. The if statement is as follows.&lt;/P&gt;&lt;P&gt;=if(((today() - aggr(max([Customer Last Trade Date]), [Customer])) &amp;gt; 42), [Customer])&lt;/P&gt;&lt;P&gt;Aggregated by Customer to find out the max last trade date, if the last trade date is 42 days ago ( 6 weeks ago), then show the Customer name as the Dimension.&lt;/P&gt;&lt;P&gt;Anyone can help?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shirley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 10:45:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-write-a-If-statement-as-Set-Analysis/m-p/201731#M501782</guid>
      <dc:creator />
      <dc:date>2010-11-25T10:45:26Z</dc:date>
    </item>
    <item>
      <title>How can I write a If statement as Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-write-a-If-statement-as-Set-Analysis/m-p/201732#M501783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shirley ,&lt;/P&gt;&lt;P&gt;Can you please share what are the expressions you are using .&lt;/P&gt;&lt;P&gt;implementing the set analysis at the expression level makes this easier .&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chakravarthy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 10:59:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-write-a-If-statement-as-Set-Analysis/m-p/201732#M501783</guid>
      <dc:creator />
      <dc:date>2010-11-25T10:59:29Z</dc:date>
    </item>
    <item>
      <title>How can I write a If statement as Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-write-a-If-statement-as-Set-Analysis/m-p/201733#M501784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Shirley,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;this can be achieved by using 'Set Analysis' with keyword &lt;STRONG&gt;1&lt;/STRONG&gt; instead of $ sign.&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;keep in mind when using the 1: the 1 in a set statement means to discard ALL of the (users) selections. Not only for Year and Month. This would be like this&lt;/P&gt;&lt;P&gt;= sum( { $ &amp;lt;Year=, Month= &amp;gt;} Amount)&lt;/P&gt;&lt;P&gt;I wonder why you want to change your calc expr. It seems to work fine so why do you want to change it?&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 11:10:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-write-a-If-statement-as-Set-Analysis/m-p/201733#M501784</guid>
      <dc:creator />
      <dc:date>2010-11-25T11:10:26Z</dc:date>
    </item>
    <item>
      <title>How can I write a If statement as Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-write-a-If-statement-as-Set-Analysis/m-p/201734#M501785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The user requirement is to show the static result, discard ALL the user selection.&lt;/P&gt;&lt;P&gt;The filter Year, Month and Date refers to customer trade date. If user select any filter like Year and Month, then the result will be only a subset and show the inactive customer who has traded on the selected date. It is not meaningful.&lt;/P&gt;&lt;P&gt;If the filter Year, Month and Date refers to customer last trade date, then it will be meaningful. However it is not.&lt;/P&gt;&lt;P&gt;So, that's why the user request to show a static result , ignore the selection from the Year, Month and Date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 11:21:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-write-a-If-statement-as-Set-Analysis/m-p/201734#M501785</guid>
      <dc:creator />
      <dc:date>2010-11-25T11:21:10Z</dc:date>
    </item>
    <item>
      <title>How can I write a If statement as Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-write-a-If-statement-as-Set-Analysis/m-p/201735#M501786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chakravarthy,&lt;/P&gt;&lt;P&gt;The first Dimension is Customer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;if(((today() - aggr(max([Customer Last Trade Date]), [Customer])) &amp;gt; 42), [Customer])&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;The first Expression is Last Trade Date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(max([Customer Last Trade Date]), [Cusomer])&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;The second Expression is Outstanding Trades:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;([Customer Yet To Mature Trade Count])&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;The LOAD SCRIPT PART is as follows:&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&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;P&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;I&gt;&lt;/I&gt;&lt;I&gt;&lt;/I&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LOAD&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;[Customer] &amp;amp; '-' &amp;amp; [Product] as [Customer Product Key],&lt;/B&gt;&lt;/P&gt;&lt;P&gt;date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(max([Trade Date]), 'DD-MMM-YYYY') &lt;B&gt;as&lt;/B&gt; [Customer Last Trade Date],&lt;/P&gt;&lt;P&gt;count&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(&lt;B&gt;distinct&lt;/B&gt; if([Value Date] &amp;gt;= today(), [Trade ID])) &lt;B&gt;as&lt;/B&gt; [Customer Yet To Mature Trade Count]&lt;/P&gt;&lt;P style="font-weight: bold"&gt;FROM &lt;EM&gt;&amp;lt;QVD FILE&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;B&gt;&lt;/B&gt; &lt;P style="font-weight: bold"&gt;Group&lt;/P&gt;&lt;B&gt;by&lt;/B&gt; [Customer], [Product]; &lt;BR /&gt;&lt;BR /&gt; &lt;B&gt;distinct&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 11:28:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-write-a-If-statement-as-Set-Analysis/m-p/201735#M501786</guid>
      <dc:creator />
      <dc:date>2010-11-25T11:28:59Z</dc:date>
    </item>
  </channel>
</rss>

