<?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: Current vs Prior Period vs same period last year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Current-vs-Prior-Period-vs-same-period-last-year/m-p/1154832#M628311</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Virendra,&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;&amp;nbsp;&amp;nbsp; I think the easiest way to do this is to set flags in your calendar script (I'm assuming your application has one).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lines like this in the script should do the job:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vToday = Floor(Today());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(DayNumberOfYear(Temp_Date)&amp;lt;=DayNumberOfYear($(vToday)),1,0)&amp;nbsp;&amp;nbsp; as YTD,&lt;/P&gt;&lt;P&gt;if(DayNumberOfQuarter(Temp_Date)&amp;lt;=DayNumberOfQuarter($(vToday)),1,0)&amp;nbsp; as QTD,&lt;/P&gt;&lt;P&gt;if(Day(Temp_Date)&amp;lt;=Day($(vToday)),1,0)&amp;nbsp;&amp;nbsp; as MTD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(EDIT : I was a bit unclear here. This script comes from a calendar script which is a preceding load where the &lt;SPAN style="font-size: 13.3333px;"&gt;Temp_Date is a field generated by a loop giving the dates between a start and end date - as per the common practice&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These flag fields can be selected in your dashboard or used in simple set analysis such as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SalesYTD = Sum({$&amp;lt;YTD = {1}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you &lt;EM&gt;really&lt;/EM&gt; want to avoid set analysis then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SalesYTD = Sum(if(YTD = 1, Sales))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SalesYTD = Sum(YTD* Sales) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Good luck&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Andrew&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Aug 2016 08:33:19 GMT</pubDate>
    <dc:creator>effinty2112</dc:creator>
    <dc:date>2016-08-23T08:33:19Z</dc:date>
    <item>
      <title>Current vs Prior Period vs same period last year</title>
      <link>https://community.qlik.com/t5/QlikView/Current-vs-Prior-Period-vs-same-period-last-year/m-p/1154830#M628309</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 want to generate multiple Kpis for the current period, prior period, same period last year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any mechanism other than set analysis like , can i generate the data in qvd level and than store into table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kindly suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 08:11:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-vs-Prior-Period-vs-same-period-last-year/m-p/1154830#M628309</guid>
      <dc:creator>singhcv123</dc:creator>
      <dc:date>2016-08-23T08:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Current vs Prior Period vs same period last year</title>
      <link>https://community.qlik.com/t5/QlikView/Current-vs-Prior-Period-vs-same-period-last-year/m-p/1154831#M628310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure why would you want to do that? You can try this approach, but this is mostly used for charts, not so much for the text box objects: &lt;A href="https://community.qlik.com/qlik-blogpost/4531"&gt;The As-Of Table&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 08:20:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-vs-Prior-Period-vs-same-period-last-year/m-p/1154831#M628310</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-08-23T08:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Current vs Prior Period vs same period last year</title>
      <link>https://community.qlik.com/t5/QlikView/Current-vs-Prior-Period-vs-same-period-last-year/m-p/1154832#M628311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Virendra,&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;&amp;nbsp;&amp;nbsp; I think the easiest way to do this is to set flags in your calendar script (I'm assuming your application has one).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lines like this in the script should do the job:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vToday = Floor(Today());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(DayNumberOfYear(Temp_Date)&amp;lt;=DayNumberOfYear($(vToday)),1,0)&amp;nbsp;&amp;nbsp; as YTD,&lt;/P&gt;&lt;P&gt;if(DayNumberOfQuarter(Temp_Date)&amp;lt;=DayNumberOfQuarter($(vToday)),1,0)&amp;nbsp; as QTD,&lt;/P&gt;&lt;P&gt;if(Day(Temp_Date)&amp;lt;=Day($(vToday)),1,0)&amp;nbsp;&amp;nbsp; as MTD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(EDIT : I was a bit unclear here. This script comes from a calendar script which is a preceding load where the &lt;SPAN style="font-size: 13.3333px;"&gt;Temp_Date is a field generated by a loop giving the dates between a start and end date - as per the common practice&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These flag fields can be selected in your dashboard or used in simple set analysis such as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SalesYTD = Sum({$&amp;lt;YTD = {1}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you &lt;EM&gt;really&lt;/EM&gt; want to avoid set analysis then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SalesYTD = Sum(if(YTD = 1, Sales))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SalesYTD = Sum(YTD* Sales) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Good luck&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Andrew&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 08:33:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-vs-Prior-Period-vs-same-period-last-year/m-p/1154832#M628311</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2016-08-23T08:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Current vs Prior Period vs same period last year</title>
      <link>https://community.qlik.com/t5/QlikView/Current-vs-Prior-Period-vs-same-period-last-year/m-p/1154833#M628312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Please, check the correct answer.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 17:29:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-vs-Prior-Period-vs-same-period-last-year/m-p/1154833#M628312</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-24T17:29:10Z</dc:date>
    </item>
  </channel>
</rss>

