<?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: Solution required in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922490#M319513</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what are you trying to accomplish? if you want rolling month n-4 for an expression to accumulate the values, you can do that in the chart (Bar, Straight table, pivot etc...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Jul 2015 17:20:36 GMT</pubDate>
    <dc:creator>maleksafa</dc:creator>
    <dc:date>2015-07-30T17:20:36Z</dc:date>
    <item>
      <title>Solution required</title>
      <link>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922488#M319511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am writting an application where i need to loop thru past 4 months from a given month one at a time in a query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what approach to take. Query requires variable in format like "YYYYMMDD".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example 1: Example since current month is July, variable will loop thru 201507, 201506, 201505, 201504.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exampl 2: We also have to be careful on year change. so if we are in Feb 2015. then loop thru will be 201502, 201501, 201412, 201411.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can you do this in qlikview and supply the variable based on above requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 16:55:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922488#M319511</guid>
      <dc:creator />
      <dc:date>2015-07-30T16:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Solution required</title>
      <link>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922489#M319512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you explain 'need to loop'? What needs to be looped?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 17:08:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922489#M319512</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-07-30T17:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Solution required</title>
      <link>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922490#M319513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what are you trying to accomplish? if you want rolling month n-4 for an expression to accumulate the values, you can do that in the chart (Bar, Straight table, pivot etc...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 17:20:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922490#M319513</guid>
      <dc:creator>maleksafa</dc:creator>
      <dc:date>2015-07-30T17:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Solution required</title>
      <link>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922491#M319514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Today= 20150730&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hence query needs to run for 201507, 201506, 201505, 201504.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;within query you will pass variable like below:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;20150401 to 20150431&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;20150501 to 20150531&lt;/P&gt;&lt;P&gt;20150601 to 20150631&lt;/P&gt;&lt;P&gt;20150701 to 20150731&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 17:30:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922491#M319514</guid>
      <dc:creator />
      <dc:date>2015-07-30T17:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Solution required</title>
      <link>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922492#M319515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this because the data source you are using only serves up one month at a time?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the query you are using?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code will loop in the load script, back a set number of months and place the month value in the format you need in a variable.&amp;nbsp; This can be used as a parameter to a load query.&amp;nbsp; In this code it just drops the variable in a table, so you can see the results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let vMonthsBack = 24;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;for i = 0 to vMonthsBack&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; let vNextMonth = Date(AddMonths(monthstart(today()), -i), 'YYYYMM');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; // place in a table to test&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; LOAD $(vNextMonth) as Month autogenerate(1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;next&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As &lt;A href="https://community.qlik.com/qlik-users/96544"&gt;gwassenaar&lt;/A&gt;‌ says though, I'm not sure quite what your requirement is, so this may or may not help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 17:38:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922492#M319515</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2015-07-30T17:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Solution required</title>
      <link>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922493#M319516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the input data and what is the end result? I have no idea if you're trying to program a procedure or create a chart that displays data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 17:38:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922493#M319516</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-07-30T17:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Solution required</title>
      <link>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922494#M319517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Example loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vstartDate=Date#('201503','YYYYMM');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=1 to 4 step 1&lt;/P&gt;&lt;P&gt;let v$(i)=Date(AddMonths(vstartDate,-i),'YYYYMM');&lt;/P&gt;&lt;P&gt;next i;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 17:53:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922494#M319517</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2015-07-30T17:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Solution required</title>
      <link>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922495#M319518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this because the data source you are using only serves up one month at a time? =&amp;gt; Yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your loop statement does not handle year change if 4 months back from today's date fall in previous year.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 20:14:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922495#M319518</guid>
      <dc:creator />
      <dc:date>2015-07-30T20:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Solution required</title>
      <link>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922496#M319519</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;The code will quite happily deal with going back past the beginning of the year.&amp;nbsp; It is not just subtracting 1, it is subtracting one month and then formatting that correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please copy and paste the code you need to execute in order to pull back each month, and someone will be able to show you how to use a variable, derived in a loop, to pass a parameter to your data query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 22:35:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Solution-required/m-p/922496#M319519</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2015-07-30T22:35:01Z</dc:date>
    </item>
  </channel>
</rss>

