<?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 Convert the if statement into a set analysis expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Convert-the-if-statement-into-a-set-analysis-expression/m-p/1357140#M515594</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;Can someone help me write the following expression using set analysis? I have to ignore the selections in fields Year &amp;amp; Month, for which I have to use Set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Value&amp;gt;0,Value, Value_FIRST - above([Total quantity]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here [Total quantity] is another column in the straight table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI- the expression for [Total quantity] is&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 288px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="120" style="border: 0px black; border-image: none;" width="288"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;fabs(Sum(&lt;BR /&gt; {$&amp;lt;Year=,Month=,&lt;BR /&gt; code={100,201,306,500}&lt;BR /&gt; &amp;gt;}&lt;BR /&gt; ValueZ))&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 May 2017 05:32:33 GMT</pubDate>
    <dc:creator>divya_anand</dc:creator>
    <dc:date>2017-05-30T05:32:33Z</dc:date>
    <item>
      <title>Convert the if statement into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-the-if-statement-into-a-set-analysis-expression/m-p/1357140#M515594</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;Can someone help me write the following expression using set analysis? I have to ignore the selections in fields Year &amp;amp; Month, for which I have to use Set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Value&amp;gt;0,Value, Value_FIRST - above([Total quantity]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here [Total quantity] is another column in the straight table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI- the expression for [Total quantity] is&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 288px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="120" style="border: 0px black; border-image: none;" width="288"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;fabs(Sum(&lt;BR /&gt; {$&amp;lt;Year=,Month=,&lt;BR /&gt; code={100,201,306,500}&lt;BR /&gt; &amp;gt;}&lt;BR /&gt; ValueZ))&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 05:32:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-the-if-statement-into-a-set-analysis-expression/m-p/1357140#M515594</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2017-05-30T05:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Convert the if statement into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-the-if-statement-into-a-set-analysis-expression/m-p/1357141#M515595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to incorporate set analysis in this way-&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;0,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Value_FIRST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; - &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;above&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;[Total quantity]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this throws up an error which I believe is because of &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;above&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;[Total quantity]&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea on this?&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 06:10:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-the-if-statement-into-a-set-analysis-expression/m-p/1357141#M515595</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2017-05-30T06:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Convert the if statement into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-the-if-statement-into-a-set-analysis-expression/m-p/1357142#M515596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;You have to use if condition here ...try like this &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;if(Value&amp;gt;0,sum({&amp;lt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #008000;"&gt;=,&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #008000;"&gt;=&lt;/SPAN&gt;&amp;gt;}Value), Value_FIRST - above([Total quantity]))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 06:31:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-the-if-statement-into-a-set-analysis-expression/m-p/1357142#M515596</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2017-05-30T06:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert the if statement into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/Convert-the-if-statement-into-a-set-analysis-expression/m-p/1357143#M515597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think you can apply multi-row aggregations (like Sum()) to in-table column references. They work on a row by row basis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on what you are trying to do, you could use the expression for the column, in place of the column reference. You may need an Aggr() if this means nesting aggregation functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 06:33:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Convert-the-if-statement-into-a-set-analysis-expression/m-p/1357143#M515597</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-05-30T06:33:26Z</dc:date>
    </item>
  </channel>
</rss>

