<?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 Help with set analysis - pivot table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693604#M1056454</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am looking for only the year 2014 which I believe to be correct.&amp;nbsp; Here is how the table shows:&lt;/P&gt;&lt;P&gt;I am having some difficulty and would like to get an opinion on how to best fix this statement.&amp;nbsp; I am trying to create a pivot table that will show premium by line of business.&amp;nbsp; When I show premium by month it works fine, but when I am trying to switch to line of business it gets rid of the top line of business.&amp;nbsp; Here is the syntax I am trying to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=&lt;SPAN style="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; ={2014}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[SumOfNET WRIT PREM]&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;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; ={2014}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[SumOfNET WRIT PREM]&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;&lt;SPAN style="font-size: 8pt;"&gt;I am looking for only the year 2014 which I believe to be correct.&amp;nbsp; Here is how the table shows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;IMG alt="Table.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/69671_Table.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;I have tried to switch to below, which also seems to be incorrect.&amp;nbsp; Any thoughts on how to best correct this problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Oct 2014 20:21:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-10-24T20:21:32Z</dc:date>
    <item>
      <title>Help with set analysis - pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693604#M1056454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am looking for only the year 2014 which I believe to be correct.&amp;nbsp; Here is how the table shows:&lt;/P&gt;&lt;P&gt;I am having some difficulty and would like to get an opinion on how to best fix this statement.&amp;nbsp; I am trying to create a pivot table that will show premium by line of business.&amp;nbsp; When I show premium by month it works fine, but when I am trying to switch to line of business it gets rid of the top line of business.&amp;nbsp; Here is the syntax I am trying to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=&lt;SPAN style="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; ={2014}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[SumOfNET WRIT PREM]&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;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; ={2014}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[SumOfNET WRIT PREM]&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;&lt;SPAN style="font-size: 8pt;"&gt;I am looking for only the year 2014 which I believe to be correct.&amp;nbsp; Here is how the table shows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;IMG alt="Table.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/69671_Table.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;I have tried to switch to below, which also seems to be incorrect.&amp;nbsp; Any thoughts on how to best correct this problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 20:21:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693604#M1056454</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-24T20:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help with set analysis - pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693605#M1056455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;try it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM({$&amp;lt;YEAR ={2014}&amp;gt;}[SumOfNET WRIT PREM])-Above(SUM({$&amp;lt;YEAR={2014}&amp;gt;}[SumOfNET WRIT PREM]))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 22:49:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693605#M1056455</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-24T22:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help with set analysis - pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693606#M1056456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; It maybe since for the first record ABOVE returns a NULL hence the subtraction evaluates to null.\. Hence use isnull to detect null and replace it by zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #0000ff;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;YEAR&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt; ={2014}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;[SumOfNET WRIT PREM]&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;)-if(isnull(&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #0000ff;"&gt;Above&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #0000ff;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;YEAR&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt; ={2014}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;[SumOfNET WRIT PREM]&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;))),0,&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #0000ff;"&gt;Above&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #0000ff;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;YEAR&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt; ={2014}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit; color: #800000;"&gt;[SumOfNET WRIT PREM]&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;)))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 8pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 8pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 8pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;Shoubhik.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2014 04:48:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693606#M1056456</guid>
      <dc:creator />
      <dc:date>2014-10-25T04:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with set analysis - pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693607#M1056457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jannet and Shoubhik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the help.&amp;nbsp; The second statement with the if(isnull has taken a step forward.&amp;nbsp; Just a few issues that I am not sure how to fix:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. When no selections are made, only Auto returns the correct value.&amp;nbsp; When selections are made, the correct value is then shown.&lt;/P&gt;&lt;P&gt;2. My data is in the form YTD, and when I try to select a month and a year, ie Feb 2014, the function no longer seems to work in MTD and returns the total for the year.&amp;nbsp; In my example, Jan is 177 and Feb is 178.&amp;nbsp; In the table when selecting Feb it returns 355.&amp;nbsp; Is there a fix when the user selects a month, or is the only fix to get MTD data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my picture to help illustrate:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Table.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/69770_Table.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Table2.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/69771_Table2.png" style="width: 620px; height: 87px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 14:02:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693607#M1056457</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-27T14:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help with set analysis - pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693608#M1056458</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;I would use Alt() instead of If(IsNull()) as it is simpler and probably more efficient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;YEAR ={2014}&amp;gt;} [SumOfNET WRIT PREM])-Alt(Above(SUM({&amp;lt;YEAR ={2014}&amp;gt;} [SumOfNET WRIT PREM])),0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 14:24:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693608#M1056458</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-10-27T14:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help with set analysis - pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693609#M1056459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;you must declare two variables in your Field_date than return the max and min .&lt;/P&gt;&lt;P&gt;min(field_date)&lt;/P&gt;&lt;P&gt;max(field_date)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;you must replace&amp;nbsp; variables on your expression&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;SUM({&amp;lt;Field_date={"&amp;lt;=$(Name_variable_Max)&amp;gt;=$(Name_variable_min)"}&amp;gt;......&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I explained&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 15:25:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693609#M1056459</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-27T15:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with set analysis - pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693610#M1056460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jannet,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not entirely sure as I am new how to properly set this up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In setting the variables what values should I set for them?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, could you show me the full syntax so I can obtain the correct results.&amp;nbsp; Ultimately I am using Year, Month, and then Net Writ Prem, and Line of Business.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for all the help so far,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 16:06:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693610#M1056460</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-27T16:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Help with set analysis - pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693611#M1056461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Justin,&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; Is there any way you can upload your sample qvw or sample record set. I tried using a sample dataset for the condition you specified but getting correct results though. !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shoubhik.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 02:35:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-set-analysis-pivot-table/m-p/693611#M1056461</guid>
      <dc:creator />
      <dc:date>2014-10-29T02:35:34Z</dc:date>
    </item>
  </channel>
</rss>

