<?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 Pivot Table - Set Analysis? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Set-Analysis/m-p/226376#M78581</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Guys,&lt;/P&gt;&lt;P&gt;I'm stuck on a pivot table calculation. I'm not sure if set analysis, if statement, aggr, or what to use on this one.&lt;/P&gt;&lt;P&gt;Pivot Table needs to be:&lt;/P&gt;&lt;P&gt;MonthYear Store Count&lt;BR /&gt;Jan-2010 102&lt;BR /&gt;Feb-2010 110&lt;BR /&gt;Mar-2010 127&lt;/P&gt;&lt;P&gt;Table 1 - The traditional calendar table with MonthYear&lt;/P&gt;&lt;P&gt;Table 2 - Fact table that links to the calendar with date and to the store dimension table with store id&lt;/P&gt;&lt;P&gt;Table 3 - Store dimension table with a store counter, open date, and close date&lt;/P&gt;&lt;P&gt;I want to count the stores for a given monthyear period within the open and close date or with null open/close dates. The trick is I want to ignore the fact table. Whenever I try it with set analysis or an if statement I get the count of stores with the open/close date within the monthyear but I'm getting only stores with a record in the fact table.&lt;/P&gt;&lt;P&gt;I can also get a min and max date with all the selected monthyear in variables and use that with TOTAL to get all stores within that period but I need it broken out by each monthyear.&lt;/P&gt;&lt;P&gt;This is the crazy set analysis I'm trying that doesn't work:&lt;/P&gt;&lt;P&gt;= sum(&lt;BR /&gt;{&amp;lt;StoreKey=, Date=, MonthYear=, OpenDate= {"&amp;lt;=$(=num(monthend(MonthYear), '#,##0')) OR Null"}, CloseDate= {"&amp;gt;=$(=num(monthstart(MonthYear), '#,##0')) OR Null"} &amp;gt;}&lt;BR /&gt; StoreCounter)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Oct 2010 03:16:56 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-10-04T03:16:56Z</dc:date>
    <item>
      <title>Pivot Table - Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Set-Analysis/m-p/226376#M78581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Guys,&lt;/P&gt;&lt;P&gt;I'm stuck on a pivot table calculation. I'm not sure if set analysis, if statement, aggr, or what to use on this one.&lt;/P&gt;&lt;P&gt;Pivot Table needs to be:&lt;/P&gt;&lt;P&gt;MonthYear Store Count&lt;BR /&gt;Jan-2010 102&lt;BR /&gt;Feb-2010 110&lt;BR /&gt;Mar-2010 127&lt;/P&gt;&lt;P&gt;Table 1 - The traditional calendar table with MonthYear&lt;/P&gt;&lt;P&gt;Table 2 - Fact table that links to the calendar with date and to the store dimension table with store id&lt;/P&gt;&lt;P&gt;Table 3 - Store dimension table with a store counter, open date, and close date&lt;/P&gt;&lt;P&gt;I want to count the stores for a given monthyear period within the open and close date or with null open/close dates. The trick is I want to ignore the fact table. Whenever I try it with set analysis or an if statement I get the count of stores with the open/close date within the monthyear but I'm getting only stores with a record in the fact table.&lt;/P&gt;&lt;P&gt;I can also get a min and max date with all the selected monthyear in variables and use that with TOTAL to get all stores within that period but I need it broken out by each monthyear.&lt;/P&gt;&lt;P&gt;This is the crazy set analysis I'm trying that doesn't work:&lt;/P&gt;&lt;P&gt;= sum(&lt;BR /&gt;{&amp;lt;StoreKey=, Date=, MonthYear=, OpenDate= {"&amp;lt;=$(=num(monthend(MonthYear), '#,##0')) OR Null"}, CloseDate= {"&amp;gt;=$(=num(monthstart(MonthYear), '#,##0')) OR Null"} &amp;gt;}&lt;BR /&gt; StoreCounter)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 03:16:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Set-Analysis/m-p/226376#M78581</guid>
      <dc:creator />
      <dc:date>2010-10-04T03:16:56Z</dc:date>
    </item>
    <item>
      <title>Pivot Table - Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Set-Analysis/m-p/226377#M78582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kristen&lt;/P&gt;&lt;P&gt;Your basic logic looks correct; I see 2 possible problems with the expression:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For this type of condition (where the search expression starts with &amp;lt;=), the value must be the same format as OpenDate, which is probably not a formatted number. My understanding is that set analysis does the comparison in text, not number, form.&lt;/LI&gt;&lt;LI&gt;I suspect that the OR Null is not valid in that context.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You could try making a full search statement instead, something like (assumes one MonthYear is selected)&lt;/P&gt;&lt;P&gt;= sum(&lt;BR /&gt;{&amp;lt;StoreKey=, Date=, MonthYear=,&lt;BR /&gt;OpenDate= {"=OpenDate&amp;lt;=$(=monthend(MonthYear)) OR IsNull(OpenDate)"},&lt;BR /&gt;CloseDate= {"=CloseDate&amp;gt;=$(=monthstart(MonthYear)) OR IsNull(CloseDate)"} &amp;gt;}&lt;BR /&gt; StoreCounter)&lt;/P&gt;&lt;P&gt;I've not tried OR like that, but if the statement works in the advanced search box, it should work in set analysis.&lt;/P&gt;&lt;P&gt;Another thing to bear in mind is that set analysis is performed on the entire data set, it does not respect chart dimensions, so if the MonthYear is coming from chart dimensions, you need to sum a sum(if...) statement instead.&lt;/P&gt;&lt;P&gt;Something like: (have not checked for proper bracket closing)&lt;/P&gt;&lt;P&gt;sum(&lt;BR /&gt;{&amp;lt;StoreKey=, Date=, MonthYear=}&lt;BR /&gt;if((OpenDate &amp;lt;= MonthEnd(MonthYear) OR IsNull(OpenDate)) AND&lt;BR /&gt;(CloseDate &amp;gt;= MonthStart(MonthYear) OR IsNull(CloseDate)), StoreCounter))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 08:08:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Set-Analysis/m-p/226377#M78582</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2010-10-04T08:08:58Z</dc:date>
    </item>
    <item>
      <title>Pivot Table - Set Analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Pivot-Table-Set-Analysis/m-p/226378#M78583</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 using Interval Match at the back end. It is a lot more easier to do if you do it this way. Please find the syntax and example for Interval Match in the Help document for QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Syed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 15:14:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pivot-Table-Set-Analysis/m-p/226378#M78583</guid>
      <dc:creator>syed_muzammil</dc:creator>
      <dc:date>2010-10-04T15:14:28Z</dc:date>
    </item>
  </channel>
</rss>

