<?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: 2 periods in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/2-periods/m-p/1191558#M385005</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Ninnart,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As there are only a fixed 12 months for a year, then you need 12 or less "if" cases in the script to process each month, and if the cut off date for each month is dynamic, then there should have some rule for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the date mapping/shift in SQL is the same as do it in Qlikview, But any way, if you solve it in SQL, that is OK.&lt;/P&gt;&lt;P&gt;But then you lose the connection of the date to be used in Sales report (which use shift date), and the normal company report in you need to combine them together. However, if you need Sales report and company report in different dash, then it dose not matter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zhihong &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Oct 2016 12:33:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-10-07T12:33:54Z</dc:date>
    <item>
      <title>2 periods</title>
      <link>https://community.qlik.com/t5/QlikView/2-periods/m-p/1191555#M385002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement where invoice date might not be the same as the company's calendar dates. &lt;/P&gt;&lt;P&gt;For example, 30th September would fall under September in the normal calendar but the cut off date for September might have been the 28th, so the sales values from 30th September will actually fall under October on the company's calendar. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the best approach to this type of data? Would having 2 period tables, each linking to their respective date type in the fact table, be practical? Or should there only be 1 date on the fact table and then we have a different field in the period table indicating the company's calendar dates? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, I'm a little lost on how to approach this scenario. Any advise would be appreciated! Thank you!! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 15:41:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/2-periods/m-p/1191555#M385002</guid>
      <dc:creator>ninnartx</dc:creator>
      <dc:date>2016-09-28T15:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: 2 periods</title>
      <link>https://community.qlik.com/t5/QlikView/2-periods/m-p/1191556#M385003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Ninnart, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can just added a SalesYear and SalesMonth in the MasterCalendar as below, then use the SalesYear and SalesMonth as dimension in the table. And at the same time, still keep a normal calendar for other calculation.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Script for the MasterCalendar:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MinMax_temp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; Min(Date) as MinDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max(Date) as MaxDate&lt;/P&gt;&lt;P&gt;RESIDENT table_with_Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMinDate = Num(Peek('MinDate', 0, 'MinMax_PDT_temp'));&lt;/P&gt;&lt;P&gt;LET vMaxDate = Num(Peek('MaxDate', 0, 'MinMax_PDT_temp'));&lt;/P&gt;&lt;P&gt;Cal_temp:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; Date($(vMinDate) + rowno() -1) as TempDate AutoGenerate $(vMaxDate) - $(vMinDate) + 1;&lt;/P&gt;&lt;P&gt;DROP TABLE MinMax_temp;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TempDate as Date,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(TempDate) as Year,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(TempDate) as Month,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (Month(TempDate)=12 and &lt;SPAN style="font-size: 13.3333px;"&gt;Day(TempDate)&amp;gt;28, Year(TempDate)+1, Year(Template)&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; ) as SalesYear, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Day(TempDate&amp;gt;28, if(&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Month(TempDate)=12, 1, &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Month(TempDate)+1&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Month(TempDate))&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;as SalesMonth,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp; ....&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #575757; font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;Resident Cal_temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #575757; font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: small;"&gt;&lt;SPAN style="color: #575757; font-size: 13.3333px; font-family: arial, helvetica, sans-serif;"&gt;Zhihong&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 13:57:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/2-periods/m-p/1191556#M385003</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-30T13:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: 2 periods</title>
      <link>https://community.qlik.com/t5/QlikView/2-periods/m-p/1191557#M385004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Zhihong, &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I don't think that would work since the cut off date isn't the same in each month. What ended up happening was that we decided to map the cut off date in SQL instead. But thank you so much for your help!!! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2016 04:59:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/2-periods/m-p/1191557#M385004</guid>
      <dc:creator>ninnartx</dc:creator>
      <dc:date>2016-10-06T04:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: 2 periods</title>
      <link>https://community.qlik.com/t5/QlikView/2-periods/m-p/1191558#M385005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Ninnart,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As there are only a fixed 12 months for a year, then you need 12 or less "if" cases in the script to process each month, and if the cut off date for each month is dynamic, then there should have some rule for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the date mapping/shift in SQL is the same as do it in Qlikview, But any way, if you solve it in SQL, that is OK.&lt;/P&gt;&lt;P&gt;But then you lose the connection of the date to be used in Sales report (which use shift date), and the normal company report in you need to combine them together. However, if you need Sales report and company report in different dash, then it dose not matter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zhihong &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2016 12:33:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/2-periods/m-p/1191558#M385005</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-07T12:33:54Z</dc:date>
    </item>
  </channel>
</rss>

