<?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: Period of previous months in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646600#M236926</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vlad, of course, month field is static, but not years. In this year this flag must get me a period october'13-March'14&lt;/P&gt;&lt;P&gt;Next year it will get me period october'14-march'15...etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i want to make such flag in script(not in expression, which i described it in header)&lt;/P&gt;&lt;P&gt;Thank you for help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jun 2014 16:39:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-06-25T16:39:04Z</dc:date>
    <item>
      <title>Period of previous months</title>
      <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646594#M236920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Arial, sans-serif; font-size: 15px;"&gt;Good day!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Arial, sans-serif; font-size: 15px;"&gt;My problem is with getting data by previous six month from some month which is getted from variable vMonth from input field&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Arial, sans-serif; font-size: 15px;"&gt;I'd tried this expression, but it doesn't work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Arial, sans-serif; font-size: 15px;"&gt;({&amp;lt;Month={"&amp;lt;=$(=vMonth)&amp;gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Arial, sans-serif; font-size: 15px;"&gt;$(=vMonth-6)"}&amp;gt;}[Volume l.])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 16:19:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646594#M236920</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-24T16:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Period of previous months</title>
      <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646595#M236921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you declare vMonth? When I work with previous months, I used follow expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Month selected by user:&lt;/P&gt;&lt;P&gt;Year_Month={$(vMaxYearMonth)]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where vMaxYearMonth=Num(Max(YearMonth))&lt;/P&gt;&lt;P&gt;- Same month previous year:&lt;/P&gt;&lt;P&gt;Year_Month={$(vPrevMaxYearMonth)}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where vPrevMaxYearMonth=Num(Max(YearMonth)-100)&lt;/P&gt;&lt;P&gt;- Year Today:&lt;/P&gt;&lt;P&gt;Year={$(vMaxYear)}, Month={"&amp;lt;=$(=Num(Max(Month)))"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-JFlorian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 16:44:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646595#M236921</guid>
      <dc:creator>javier_florian</dc:creator>
      <dc:date>2014-06-24T16:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Period of previous months</title>
      <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646596#M236922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue may be the field that you are trying to use (Month). If your month is provided in format MMM-YYYY or something similar, then you can't use that for a &amp;gt; and &amp;lt; comparison. I would suggest switching it to a comparison that uses lowest-level dates in the set analysis. Something like: sum({&amp;lt;Date={"&amp;gt;=$(vDateStart)&amp;lt;=$(vDateEnd)"}&amp;gt;}[Volume I.])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These 2 variables would be new variables that you should create. The definition would be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vDateStart&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=addmonths(monthstart(vMonth),-6)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vDateEnd&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=monthend(vMonth)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 18:28:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646596#M236922</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2014-06-24T18:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Period of previous months</title>
      <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646597#M236923</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;If you use Month in your set analysis you need specify text value, is better if you use a date value or a MonthYear value, in the next example I use a field MonthYear declared in my calendar "MonthName(myDate) as MonthYear"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expresion that I use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;MonthYear = {'$(=MonthName(AddMonths(Max(myDate),-6)))'}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 18:34:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646597#M236923</guid>
      <dc:creator />
      <dc:date>2014-06-24T18:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Period of previous months</title>
      <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646598#M236924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you for answer,&lt;BR /&gt;now my problem is more simple...&lt;/P&gt;&lt;P&gt;i have field with years (...2013,2014)&lt;/P&gt;&lt;P&gt;field with monthName(....Apr,May,Jun)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what must i write in script to make some flag, which will get dynamically period from March this year to October last year?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 11:52:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646598#M236924</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-25T11:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Period of previous months</title>
      <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646599#M236925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrey, I'm not sure I understand. If the months you want to flag in the script are static, what is "dynamic"? Perhaps you mean how can you write the UI expression I mentioned above without a single field for MonthYear? It might be easier if you mention exactly (1) what filters values users select, and (2) what the expected result is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 15:03:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646599#M236925</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2014-06-25T15:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Period of previous months</title>
      <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646600#M236926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vlad, of course, month field is static, but not years. In this year this flag must get me a period october'13-March'14&lt;/P&gt;&lt;P&gt;Next year it will get me period october'14-march'15...etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i want to make such flag in script(not in expression, which i described it in header)&lt;/P&gt;&lt;P&gt;Thank you for help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 16:39:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646600#M236926</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-25T16:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Period of previous months</title>
      <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646601#M236927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I still don't understand what you're trying to achieve. What are users selecting? What are you displaying and in what medium? Feel free to answer in Russian, if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 16:53:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646601#M236927</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2014-06-25T16:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Period of previous months</title>
      <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646602#M236928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;В отчете в выражении у меня очень много фрагментов формулы, которая считает средние продажи за последние 6 месяцев, начиная с марта 2014:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;ГодМесяц={201403,201402,201401,201312,201311,201310}&amp;gt;}Volume)/6&lt;/P&gt;&lt;P&gt;Для того, чтобы не менять все вручную заново в следующем году, мне нужно создать флаг, который сам автоматически будет брать период с марта текущего года по октябрь прошлого.&lt;BR /&gt;То есть, в следующем году он возьмет март.15-октябрь.14&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Спасибо)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 17:37:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646602#M236928</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-25T17:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Period of previous months</title>
      <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646603#M236929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see. So, basically, if the user selects 2014, you want to display the average for October 2013 - March 2014. In that case, use the following expression and change the variables as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;ГодМесяц={"&amp;gt;=$(vDateStart)&amp;lt;=$(vDateEnd)")&amp;gt;}Volume)/6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vDateStart&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=(vMaxYear-1) &amp;amp; '10'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vDateEnd&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=vMaxYear &amp;amp; '03'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vMaxYear&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=max({&amp;lt;Месяц={3}&amp;gt;}Год)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's no need to create any flag in the script. This expression assumes that the user is, in fact, selecting a year. If no year is selected, the maximum available year (that has a March month) in the data set will be used. Is that what you were looking for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 18:17:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646603#M236929</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2014-06-25T18:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Period of previous months</title>
      <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646604#M236930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;да, это то что я искал&lt;/P&gt;&lt;P&gt;Я так понимаю,эти переменные я должен прописать в скрипте или ?&lt;/P&gt;&lt;P&gt;Можете написать по подробней, что делает переменная &lt;STRONG style="color: #3d3d3d; font-family: inherit; font-size: 12px; font-style: inherit;"&gt;vMaxYear&lt;/STRONG&gt;?&lt;BR /&gt;Есть ли&amp;nbsp; у меня возможность прописать выражения целиком, чтобы не использовать переменные, которые считаются еще отдельным выражением?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 18:59:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646604#M236930</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-25T18:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Period of previous months</title>
      <link>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646605#M236931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You define variables in the variable overview--CTRL+ALT+V. Make sure that they start with an equal sign as I wrote them above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vMaxYear is used as a control to make sure that the user actually selects a valid year. For example, if I select 2014 and 2015 (today), vMaxYear will return 2014 since March 2015 hasn't happened yet. Likewise, if I select no year, vMaxYear will still return 2014. If I select 2013, however, vMaxYear will return 2013.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose you can do it without variables, but why would you want to? They just make life easier and don't hurt anything in terms of performance. Plus they make it much easier to maintain the application, since each component can be updated separately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As always, marking correct answers as correct is much appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vlad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 20:19:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Period-of-previous-months/m-p/646605#M236931</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2014-06-25T20:19:46Z</dc:date>
    </item>
  </channel>
</rss>

