<?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 Get previous period in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174355#M43213</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I have the next formula to get values from the previous year;&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;[Fiscal year]={$(=maxstring([PIT year])-1)},[Fiscal period]={$(=maxstring([PIT period]))}&amp;gt;}[Total branches])&lt;/P&gt;&lt;P&gt;Working fine!&lt;/P&gt;&lt;P&gt;Now i want to get values from the previous month, I've tried this;&lt;/P&gt;&lt;P&gt;(Months are , 01, 02, 03, 04,........,12)&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;[Fiscal year]={$(=maxstring([PIT year]))},[Fiscal period]={$(=maxstring([PIT period])-1)}&amp;gt;}[Total branches])&lt;/P&gt;&lt;P&gt;This one isn't working, so I tried this one&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;[Fiscal year]={$(=maxstring([PIT year]))},[Fiscal period]={$(=RIGHT('00'&amp;amp;maxstring([PIT period])-1,2))}&amp;gt;}[Total branches])&lt;/P&gt;&lt;P&gt;Also not working&lt;/P&gt;&lt;P&gt;Of course I also have to do an if function to get the value for month '01' right, but first I want to solve above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give me a hand?, Thnx in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Mar 2011 13:55:36 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-22T13:55:36Z</dc:date>
    <item>
      <title>Get previous period</title>
      <link>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174355#M43213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I have the next formula to get values from the previous year;&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;[Fiscal year]={$(=maxstring([PIT year])-1)},[Fiscal period]={$(=maxstring([PIT period]))}&amp;gt;}[Total branches])&lt;/P&gt;&lt;P&gt;Working fine!&lt;/P&gt;&lt;P&gt;Now i want to get values from the previous month, I've tried this;&lt;/P&gt;&lt;P&gt;(Months are , 01, 02, 03, 04,........,12)&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;[Fiscal year]={$(=maxstring([PIT year]))},[Fiscal period]={$(=maxstring([PIT period])-1)}&amp;gt;}[Total branches])&lt;/P&gt;&lt;P&gt;This one isn't working, so I tried this one&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;[Fiscal year]={$(=maxstring([PIT year]))},[Fiscal period]={$(=RIGHT('00'&amp;amp;maxstring([PIT period])-1,2))}&amp;gt;}[Total branches])&lt;/P&gt;&lt;P&gt;Also not working&lt;/P&gt;&lt;P&gt;Of course I also have to do an if function to get the value for month '01' right, but first I want to solve above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give me a hand?, Thnx in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2011 13:55:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174355#M43213</guid>
      <dc:creator />
      <dc:date>2011-03-22T13:55:36Z</dc:date>
    </item>
    <item>
      <title>Get previous period</title>
      <link>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174356#M43214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will need a date field, instead of doing the year and the month separately. And from that date field you need to subtract 1 month using the AddMonths function for example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2011 14:07:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174356#M43214</guid>
      <dc:creator />
      <dc:date>2011-03-22T14:07:26Z</dc:date>
    </item>
    <item>
      <title>Get previous period</title>
      <link>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174357#M43215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried this one, but isn't working&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;[Fiscal year]={$(=maxstring([PIT year]))},[Fiscal period]={Month( AddMonths('01-'&amp;amp;$(=maxstring([PIT period]))&amp;amp;'-'&amp;amp;$(=maxstring([PIT year])),-1))}&amp;gt;}Branches)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2011 14:28:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174357#M43215</guid>
      <dc:creator />
      <dc:date>2011-03-22T14:28:29Z</dc:date>
    </item>
    <item>
      <title>Get previous period</title>
      <link>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174358#M43216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone another hint, you would help me out a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2011 15:31:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174358#M43216</guid>
      <dc:creator />
      <dc:date>2011-03-22T15:31:48Z</dc:date>
    </item>
    <item>
      <title>Get previous period</title>
      <link>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174359#M43217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First, I'm wondering why do you need ot use MaxString - are your Years and Months represented as strings?&lt;/P&gt;&lt;P&gt;The best advise I can give is not to overly complicate your Set Analysis conditions, but rather to pre-calculate Flags in your load script for Prior Year, Prior Month, etc... You can use IF statements to check if certain Date belongs to the Prior Year or to Prior Period, or to Rolling 12 Months, etc...&lt;/P&gt;&lt;P&gt;Then your Set Analysis will always be very simple :&lt;/P&gt;&lt;P&gt;sum( {&amp;lt;PriorYearFlag = {1}&amp;gt;} ...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2011 15:44:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174359#M43217</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2011-03-22T15:44:37Z</dc:date>
    </item>
    <item>
      <title>Get previous period</title>
      <link>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174360#M43218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there - I've uploaded a shared QlikView with an example of Prior Period comparisons - this may be of some help to you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/qlikviews/http://community.qlik.com/qlikviews/1175"&gt;http://community.qlik.com/qlikviews/1175&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.quickintelligence.co.uk/"&gt;http://www.quickintelligence.co.uk/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 21:09:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-previous-period/m-p/174360#M43218</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2011-11-16T21:09:42Z</dc:date>
    </item>
  </channel>
</rss>

