<?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 Need to replace &amp;quot;fixed&amp;quot; variable name with a dynamic one, based on date. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-to-replace-quot-fixed-quot-variable-name-with-a-dynamic-one/m-p/731914#M262120</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am importing an excel file which has three fields called "Quota_M1", "Quota_M2" and "Quota_M3".&amp;nbsp; The 1/2/3 in these fields represent the month number in the quarter.&amp;nbsp; I want my app to reconize the month of the quarter at the time of LOAD and have an expression which SUMS the corresponding "Quota" value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if I load the data today using the code below, I want my expression to be Sum(Quota_M3)...because M3 represents JUN, which is the 3rd month in the current quarter (APR-MAY-JUN).&amp;nbsp; But when the data loads next month, I want the expression to dynamically represent Sum(Quota_M1), as JUL is the 1st month of that quarter. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* LOAD today's date */&lt;/P&gt;&lt;P&gt; Let&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vLoadDate &lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Now&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),'M/D/YYYY'); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would this be done via an expression formula, (and if so, how?), or better handled in the script (and if so, how?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&amp;nbsp; Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jun 2014 22:36:27 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-06-23T22:36:27Z</dc:date>
    <item>
      <title>Need to replace "fixed" variable name with a dynamic one, based on date.</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-replace-quot-fixed-quot-variable-name-with-a-dynamic-one/m-p/731914#M262120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am importing an excel file which has three fields called "Quota_M1", "Quota_M2" and "Quota_M3".&amp;nbsp; The 1/2/3 in these fields represent the month number in the quarter.&amp;nbsp; I want my app to reconize the month of the quarter at the time of LOAD and have an expression which SUMS the corresponding "Quota" value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if I load the data today using the code below, I want my expression to be Sum(Quota_M3)...because M3 represents JUN, which is the 3rd month in the current quarter (APR-MAY-JUN).&amp;nbsp; But when the data loads next month, I want the expression to dynamically represent Sum(Quota_M1), as JUL is the 1st month of that quarter. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* LOAD today's date */&lt;/P&gt;&lt;P&gt; Let&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vLoadDate &lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Now&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(),'M/D/YYYY'); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would this be done via an expression formula, (and if so, how?), or better handled in the script (and if so, how?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&amp;nbsp; Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 22:36:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-replace-quot-fixed-quot-variable-name-with-a-dynamic-one/m-p/731914#M262120</guid>
      <dc:creator />
      <dc:date>2014-06-23T22:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need to replace "fixed" variable name with a dynamic one, based on date.</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-replace-quot-fixed-quot-variable-name-with-a-dynamic-one/m-p/731915#M262121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="quota.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/61032_quota.PNG.png" style="width: 620px; height: 220px;" /&gt;&lt;/P&gt;&lt;P&gt;Hi Dan, PFA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2014 23:36:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-replace-quot-fixed-quot-variable-name-with-a-dynamic-one/m-p/731915#M262121</guid>
      <dc:creator />
      <dc:date>2014-06-23T23:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need to replace "fixed" variable name with a dynamic one, based on date.</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-replace-quot-fixed-quot-variable-name-with-a-dynamic-one/m-p/731916#M262122</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;Below script may help you to achieve that,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vQuotaQuarter = 'Quota_M'&amp;amp;Ceil(Num(Month(vLoadDate))/3);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ........&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Match(Month(&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 8pt; font-family: inherit; color: #808080;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-size: 8pt; font-family: inherit;"&gt;vLoadDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;), 'Jan', 'Apr', 'Jul', 'Oct'), &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Quota_M1&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Match(Month(&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 8pt; font-family: inherit; color: #808080;"&gt;vLoadDate&lt;/EM&gt;&lt;/STRONG&gt;), 'Feb', 'May', 'Aug', 'Nov'), &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Quota_M2&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Match(Month(&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-size: 8pt; font-family: inherit; color: #808080;"&gt;vLoadDate&lt;/EM&gt;&lt;/STRONG&gt;), 'Mar', 'Jun', 'Sep', 'Dec'), &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Quota_M3) as $(vQuotaQuarter)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 03:26:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-replace-quot-fixed-quot-variable-name-with-a-dynamic-one/m-p/731916#M262122</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-24T03:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need to replace "fixed" variable name with a dynamic one, based on date.</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-replace-quot-fixed-quot-variable-name-with-a-dynamic-one/m-p/731917#M262123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;Try this sample script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab:&lt;/P&gt;&lt;P&gt;load * inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;quota_m1, quota_m2, quota_m3&lt;/P&gt;&lt;P&gt;1,2,3&lt;/P&gt;&lt;P&gt;4,5,6&lt;/P&gt;&lt;P&gt;7,8,9&lt;/P&gt;&lt;P&gt;10,11,12&lt;/P&gt;&lt;P&gt;13,14,15&lt;/P&gt;&lt;P&gt;16,17,18&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vCurrentMonthInQuarter = Month(Today()) - Month(QuarterStart(Today())) + 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab1:&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;Pick($(vCurrentMonthInQuarter), quota_m1, quota_m2, quota_m3) as Quota&lt;/P&gt;&lt;P&gt;resident tab;&lt;/P&gt;&lt;P&gt;Drop table tab;&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>Tue, 24 Jun 2014 04:12:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-replace-quot-fixed-quot-variable-name-with-a-dynamic-one/m-p/731917#M262123</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-06-24T04:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need to replace "fixed" variable name with a dynamic one, based on date.</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-replace-quot-fixed-quot-variable-name-with-a-dynamic-one/m-p/731918#M262124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=If(Month(Today())='Jan' or Month(Today())='Apr' or Month(Today())='Jul' or Month(Today())='Oct',Sum(Quota_M1),&lt;/P&gt;&lt;P&gt;if(Month(Today())='Feb' or Month(Today())='May' or Month(Today())='Aug' or Month(Today())='Nov',Sum(Quota_M2),&lt;/P&gt;&lt;P&gt;if(Month(Today())='Mar' or Month(Today())='Jun' or Month(Today())='Sep' or Month(Today())='Dec',Sum(Quota_M3))))&lt;/P&gt;&lt;P&gt;Replace Today() with your load date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 05:36:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-replace-quot-fixed-quot-variable-name-with-a-dynamic-one/m-p/731918#M262124</guid>
      <dc:creator />
      <dc:date>2014-06-24T05:36:47Z</dc:date>
    </item>
  </channel>
</rss>

