<?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: how to do a rolling 13 in SQl select statement? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448250#M167250</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ohh god i am so sorry all through this time that was the only mistake i was making it was the semicolon. it is perfectly working thanks Alejandro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Jun 2013 16:30:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-06-06T16:30:08Z</dc:date>
    <item>
      <title>how to do a rolling 13 in SQl select statement?</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448241#M167241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here i am pulling the data from source and i want to get the data only from past 13 months rolling.&lt;/P&gt;&lt;P&gt;i was trying to use a variable to store this,&lt;/P&gt;&lt;P&gt;Let vRolling=date(MonthStart(AddMonths(Date(Today()),-13)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then,&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM "Table_name" Where Date_Field&amp;gt;$(vRolling)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am getting an error which says script line error, can some one help me whats wrong with the path?&lt;/P&gt;&lt;P&gt;I know that we cannot use qlikview functions during ODBC query but i tried.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 14:48:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448241#M167241</guid>
      <dc:creator />
      <dc:date>2013-06-06T14:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to do a rolling 13 in SQl select statement?</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448242#M167242</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;Let vRolling = date(MonthStart(AddMonths(Date(Today()), -13)), &lt;STRONG&gt;'yyyy-m-d'&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TEst:&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;FROM TableName&lt;/P&gt;&lt;P&gt;WHERE Date_Field&amp;gt; '$(vRolling)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works for me, in the above let statement change date format with your date format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 15:21:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448242#M167242</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2013-06-06T15:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to do a rolling 13 in SQl select statement?</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448243#M167243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How is the format of the field &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Date_Field&lt;/SPAN&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Date_Field&lt;/SPAN&gt; = ddmmyyyy&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;Date_Field = dd-mm-yyyy;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then the variable vRolling be equal to the format &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Date_Field&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Arial; background-color: #ffffff;"&gt;you try these,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;then,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;SQL SELECT *&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;FROM "Table_name" Where Date_Field&amp;gt;&lt;SPAN style="color: #ff0000;"&gt;'&lt;/SPAN&gt;$(vRolling)&lt;SPAN style="color: #ff0000;"&gt;';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 15:23:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448243#M167243</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-06T15:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to do a rolling 13 in SQl select statement?</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448244#M167244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did change the format to which the source has which 'MM/DD/YYYY' no still i see the script line error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vRolling=date(MonthStart(AddMonths(Date(Today()),-13)),'MM/DD/YYYY')&lt;/P&gt;&lt;P&gt; FYI- before this i gave a hard code value '03/04/2012' it was working fine Also&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt; this an ODBC query&lt;/STRONG&gt;&lt;/SPAN&gt;. Not sure if something needs to be tweaked arounf the format or the script?&lt;IMG __jive_id="42219" class="jive-image-thumbnail jive-image" onclick="" alt="untitled.JPG" src="https://community.qlik.com/legacyfs/online/42219_untitled.JPG" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 15:39:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448244#M167244</guid>
      <dc:creator />
      <dc:date>2013-06-06T15:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to do a rolling 13 in SQl select statement?</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448245#M167245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alejandro,&lt;/P&gt;&lt;P&gt;Date_field format on the source is 'MM/DD/YYYY', i have tried to mtach the format to the let statement variable but no luck?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 15:44:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448245#M167245</guid>
      <dc:creator />
      <dc:date>2013-06-06T15:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to do a rolling 13 in SQl select statement?</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448246#M167246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Let vRolling=date(MonthStart(AddMonths(Date(Today()),-13)),'MM/DD/YYYY')&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prueba:&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;SQL SELECT *&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;FROM "Table_name" Where Date_Field&amp;gt;&lt;SPAN style="color: #ff0000;"&gt;'&lt;/SPAN&gt;$(vRolling)&lt;SPAN style="color: #ff0000;"&gt;'&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 15:47:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448246#M167246</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-06T15:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to do a rolling 13 in SQl select statement?</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448247#M167247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you attach the sample file with script and sample data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 15:48:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448247#M167247</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2013-06-06T15:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to do a rolling 13 in SQl select statement?</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448248#M167248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, thats exactly what i have tried to do, but no luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 16:14:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448248#M167248</guid>
      <dc:creator />
      <dc:date>2013-06-06T16:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to do a rolling 13 in SQl select statement?</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448249#M167249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you are missing semicolon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 18pt; color: #ff0000;"&gt;&lt;SPAN style="font-size: 10pt; color: #000000;"&gt;Let vRolling=date(MonthStart(AddMonths(date(today()),-13)),'MM/DD/YYYY')&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;$(_qvd_name):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;SQL SELECT *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;FROM "DIM_TR"."T_TRAN" where NC_TRANS_DT&amp;gt;='&lt;SPAN style="color: #ff0000; font-size: 24px;"&gt;$&lt;/SPAN&gt;(vRolling)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 18pt; color: #ff0000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 16:19:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448249#M167249</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-06T16:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to do a rolling 13 in SQl select statement?</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448250#M167250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ohh god i am so sorry all through this time that was the only mistake i was making it was the semicolon. it is perfectly working thanks Alejandro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 16:30:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448250#M167250</guid>
      <dc:creator />
      <dc:date>2013-06-06T16:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to do a rolling 13 in SQl select statement?</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448251#M167251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mohan it was the Semicolon that i was missing from the sytax but its working now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 16:41:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-do-a-rolling-13-in-SQl-select-statement/m-p/448251#M167251</guid>
      <dc:creator />
      <dc:date>2013-06-06T16:41:12Z</dc:date>
    </item>
  </channel>
</rss>

