<?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: Sum if statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599888#M1113606</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;={'&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="color: gray; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;$(=Only(Year)-1 )'&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;}, Brand={'$(category)'}&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;&amp;gt;}Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;={"&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="color: gray; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;$(=Only(Year)-1 )"&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;}, Brand={'$(category)'}&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;&amp;gt;}Value)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Feb 2014 14:55:47 GMT</pubDate>
    <dc:creator>santharubban</dc:creator>
    <dc:date>2014-02-18T14:55:47Z</dc:date>
    <item>
      <title>Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599883#M1113601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi I am trying to get a sum statment to work.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;See below I want to sum value if brand =category and year is previous year to selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried a few way around it but cant seem to get it too work. Any suggestions welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(=Only(Year-1))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&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;Brand&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Category&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;gt;}Value) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Paul&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 13:20:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599883#M1113601</guid>
      <dc:creator />
      <dc:date>2014-02-18T13:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599884#M1113602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If category is a field it will never work because set analysis can't compare a field with another field. In set analysis yu can't use if statement:.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add your example and I'll help you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 13:23:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599884#M1113602</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2014-02-18T13:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599885#M1113603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try some thing like&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #312e25; font-family: monospace; font-size: 11px; background-color: #f5f3e5;"&gt;Sum({$&amp;lt;year={$(=(year(today())-1))},Brand={'category'}&amp;gt;}Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 13:25:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599885#M1113603</guid>
      <dc:creator />
      <dc:date>2014-02-18T13:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599886#M1113604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Brand = Category, Sum({$&amp;lt;Year = {'$(=Max(Year-1))}&amp;gt;}) Value))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 13:28:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599886#M1113604</guid>
      <dc:creator />
      <dc:date>2014-02-18T13:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599887#M1113605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot use IF in the set analysis, and if you want to compare two fields (A=B) you need a third one. here, I have added a BrandID field to show you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the year, you must get the result of your expression, and afterwards do -1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try:&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Helvetica','sans-serif'; color: maroon; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 8pt;"&gt;={&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="font-family: 'Helvetica','sans-serif'; color: gray; font-size: 8pt;"&gt;$(=Only(Year)-1 )&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 8pt;"&gt;}, BrandID = {“=(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Helvetica','sans-serif'; color: maroon; font-size: 8pt;"&gt;Brand&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Helvetica','sans-serif'; color: maroon; font-size: 8pt;"&gt;Category)”&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 8pt;"&gt;} &amp;gt;}Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 8pt;"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Helvetica','sans-serif'; color: #3d3d3d; font-size: 8pt;"&gt;Fabrice&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 13:32:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599887#M1113605</guid>
      <dc:creator />
      <dc:date>2014-02-18T13:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599888#M1113606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;={'&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="color: gray; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;$(=Only(Year)-1 )'&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;}, Brand={'$(category)'}&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;&amp;gt;}Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;={"&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN lang="EN-US" style="color: gray; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;$(=Only(Year)-1 )"&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;}, Brand={'$(category)'}&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: #3d3d3d; font-family: 'Helvetica','sans-serif'; font-size: 8pt;"&gt;&amp;gt;}Value)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 14:55:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599888#M1113606</guid>
      <dc:creator>santharubban</dc:creator>
      <dc:date>2014-02-18T14:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599889#M1113607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or Brand = p(Category)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 15:09:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599889#M1113607</guid>
      <dc:creator />
      <dc:date>2014-02-18T15:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599890#M1113608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aunez,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is two fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have is sales data which has Category and target by brands.&amp;nbsp; Both are same ie Product A in both&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to do is put them in a table so you haveLike this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Target&lt;/P&gt;&lt;P&gt;Brand A&lt;/P&gt;&lt;P&gt;Brand B&lt;/P&gt;&lt;P&gt;This issue I get at current is that it does not brek the target down by Brand uust sums a total hence the brand equals category.&lt;/P&gt;&lt;P&gt;This statemnt I curently havein&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(=(year(today())-1))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Brand&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;p&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Category&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)&amp;gt;}&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;/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;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 15:25:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599890#M1113608</guid>
      <dc:creator />
      <dc:date>2014-02-18T15:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599891#M1113609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No&lt;/P&gt;&lt;P&gt;QlikView computes the set analysis only ONCE, before computing the chart&lt;/P&gt;&lt;P&gt;it cannot be broken by rows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should go back to a sum(if ....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 15:34:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599891#M1113609</guid>
      <dc:creator />
      <dc:date>2014-02-18T15:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599892#M1113610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay have gone back to&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&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;Brand&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Category&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &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;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;and I get this years sales which is great but I now wish to show last years sales.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;I tried &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&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;Brand&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Category&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='2013',&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))&amp;nbsp; but I dont get any results.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks for the help.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 15:47:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599892#M1113610</guid>
      <dc:creator />
      <dc:date>2014-02-18T15:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599893#M1113611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i would do,&lt;/P&gt;&lt;P&gt;if(Brand=Category, sum({&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif'; font-size: 11pt;"&gt;&amp;lt;Year &lt;STRONG&gt;=&lt;/STRONG&gt; {&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; color: red; font-size: 10pt;"&gt;"$(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif'; color: red; font-size: 11pt;"&gt;=max(Year)-1)&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; color: red; font-size: 10pt;"&gt;"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif'; font-size: 11pt;"&gt;}&amp;gt;&amp;nbsp; } Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif'; font-size: 11pt;"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif'; font-size: 11pt;"&gt;The set analysis must be in an aggregation function (therefore sum is OK)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif'; font-size: 11pt;"&gt;It is computed only ONCE (we want to get the previous year, always the same: it is OK)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif'; font-size: 11pt;"&gt;You can replace Max with Only if you have only one year selected by the user.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif'; font-size: 11pt;"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif'; font-size: 11pt;"&gt;Tell me&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif'; font-size: 11pt;"&gt;Fabrice&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 15:54:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599893#M1113611</guid>
      <dc:creator />
      <dc:date>2014-02-18T15:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599894#M1113612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Thanks the sum({&lt;SPAN lang="EN-US" style="font-family: 'Arial', 'sans-serif'; font-size: 11pt;"&gt;&amp;lt;Year &lt;STRONG&gt;=&lt;/STRONG&gt; {&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; color: red; font-size: 10pt;"&gt;"$(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial', 'sans-serif'; color: red; font-size: 11pt;"&gt;=max(Year)-1)&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Courier New'; color: red; font-size: 10pt;"&gt;"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial', 'sans-serif'; font-size: 11pt;"&gt;}&amp;gt;&amp;nbsp; } Sales) works fine but as soon as I add the If statement I dont get any results..&amp;nbsp; If I do sum(if(Brand=Category) I do get data but only for vcurrent year.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 16:25:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599894#M1113612</guid>
      <dc:creator />
      <dc:date>2014-02-18T16:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599895#M1113613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course !!&lt;/P&gt;&lt;P&gt;Brand is unique (because one row per brand)&lt;/P&gt;&lt;P&gt;But Category is not unique. So if you do such comparison Brand (unique) = Category (not unique) , it will be false&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have perhaps add a flag (1/0) in the appropriate table&lt;/P&gt;&lt;P&gt;After that you will have the choice to use the flag where you want:&lt;/P&gt;&lt;P&gt;in the expression : Sales*Flag&lt;/P&gt;&lt;P&gt;in the IF (Flag = 1, ....)&lt;/P&gt;&lt;P&gt;in the set : sum&lt;SPAN style="font-size: 8pt;"&gt;( {&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Flag&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={1}, &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;"$(=max(Year)-1)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt; } &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Sales&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The last one is quicker.&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 16:52:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-statement/m-p/599895#M1113613</guid>
      <dc:creator />
      <dc:date>2014-02-18T16:52:39Z</dc:date>
    </item>
  </channel>
</rss>

