<?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 Set Analysis by dimension in a pivot table? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-by-dimension-in-a-pivot-table/m-p/155342#M31632</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 have a pivot table that have two dimension ("Demand Group" and "Week") like this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-3766_sourceID:3766" /&gt;&lt;/P&gt;&lt;P&gt;In my model, each week has an index number. For tests, I put 4 expressions:&lt;/P&gt;&lt;P&gt;Week: Contains the week (as in dimension) and its index&lt;BR /&gt;Week-2: Contains the index of 2 weeks ago (if 2011P01W3 =&amp;gt; Week-2 = 2011P01W1 for example)&lt;/P&gt;&lt;P&gt;Then, in my fact table, I have the week corresponding to the date of the fact and a version (that is the week at which data were uploaded, to keep an history and compare in time).&lt;/P&gt;&lt;P&gt;So I can have:&lt;BR /&gt; Qty = 100 for FactDateWeek=2011P01W3 and Version=2011P01W3 (data for the week uploaded the same week)&lt;BR /&gt; Qty = 200 for FactDateWeek=2011P01W3 and Version=2011P01W1 (data for the same week but uploaded 2 weeks ago)&lt;/P&gt;&lt;P&gt;The "Dyn" expression should calculate the sum of Qty of "Week" with Version = Week-2 for each column of my "Week" dimension.&lt;BR /&gt;For this, I used the following Set Analysis and declare "Dyn" as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;=sum(&lt;BR /&gt; {&lt;BR /&gt; $&lt;BR /&gt; &amp;lt;&lt;BR /&gt; Version_Week_Index={'$(=only(YrPdWk_Index + 2))'}&lt;BR /&gt; &amp;gt;&lt;BR /&gt; } Qty&lt;BR /&gt; )&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The result is ok if I select only one Week in the Selection box&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-3767_sourceID:3767" /&gt;&lt;/P&gt;&lt;P&gt;But if I display every weeks (what I need to do), I only have "0" as below:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-3768_sourceID:3768" /&gt;&lt;/P&gt;&lt;P&gt;After some research on the forum, my understanding is that I cannot use Set Analysis to loop on every column of my Week dimension. Is that correct ? (I'm new on QlikView).&lt;/P&gt;&lt;P&gt;Could someone help me with an idea please ?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Mar 2011 23:53:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-10T23:53:44Z</dc:date>
    <item>
      <title>Set Analysis by dimension in a pivot table?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-by-dimension-in-a-pivot-table/m-p/155342#M31632</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 have a pivot table that have two dimension ("Demand Group" and "Week") like this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-3766_sourceID:3766" /&gt;&lt;/P&gt;&lt;P&gt;In my model, each week has an index number. For tests, I put 4 expressions:&lt;/P&gt;&lt;P&gt;Week: Contains the week (as in dimension) and its index&lt;BR /&gt;Week-2: Contains the index of 2 weeks ago (if 2011P01W3 =&amp;gt; Week-2 = 2011P01W1 for example)&lt;/P&gt;&lt;P&gt;Then, in my fact table, I have the week corresponding to the date of the fact and a version (that is the week at which data were uploaded, to keep an history and compare in time).&lt;/P&gt;&lt;P&gt;So I can have:&lt;BR /&gt; Qty = 100 for FactDateWeek=2011P01W3 and Version=2011P01W3 (data for the week uploaded the same week)&lt;BR /&gt; Qty = 200 for FactDateWeek=2011P01W3 and Version=2011P01W1 (data for the same week but uploaded 2 weeks ago)&lt;/P&gt;&lt;P&gt;The "Dyn" expression should calculate the sum of Qty of "Week" with Version = Week-2 for each column of my "Week" dimension.&lt;BR /&gt;For this, I used the following Set Analysis and declare "Dyn" as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;=sum(&lt;BR /&gt; {&lt;BR /&gt; $&lt;BR /&gt; &amp;lt;&lt;BR /&gt; Version_Week_Index={'$(=only(YrPdWk_Index + 2))'}&lt;BR /&gt; &amp;gt;&lt;BR /&gt; } Qty&lt;BR /&gt; )&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The result is ok if I select only one Week in the Selection box&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-3767_sourceID:3767" /&gt;&lt;/P&gt;&lt;P&gt;But if I display every weeks (what I need to do), I only have "0" as below:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-3768_sourceID:3768" /&gt;&lt;/P&gt;&lt;P&gt;After some research on the forum, my understanding is that I cannot use Set Analysis to loop on every column of my Week dimension. Is that correct ? (I'm new on QlikView).&lt;/P&gt;&lt;P&gt;Could someone help me with an idea please ?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2011 23:53:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-by-dimension-in-a-pivot-table/m-p/155342#M31632</guid>
      <dc:creator />
      <dc:date>2011-03-10T23:53:44Z</dc:date>
    </item>
  </channel>
</rss>

