<?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: SET Variable in load script issue with $ in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SET-Variable-in-load-script-issue-with/m-p/1810378#M1212546</link>
    <description>&lt;P&gt;Ok,&lt;/P&gt;&lt;P&gt;I was able to get it to work by using the replace on vCurrentPeriodStartDate as you suggested, but I still had to run the syntax for my LET statement above to get it to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the final solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SET vCurrentPeriodTempStartDate = "(DATE(MonthStart(AddMonths(CurrentSelectionMonthYear,-@(vRunRate)+1,1)),'MMM-YYYY'))";&lt;BR /&gt;LET vCurrentPeriodStartDate = Replace('$(vCurrentPeriodTempStartDate)','@','$');&lt;/P&gt;&lt;P&gt;LET eCasesCurrentPeriodRunRate = 'SUM({&amp;lt;CalendarMonthYear= {"&amp;gt;=$'&amp;amp;'(=$'&amp;amp;'(vCurrentPeriodStartDate))&amp;lt;=$'&amp;amp;'(=$'&amp;amp;'(vCurrentPeriodEndDate))"},CalendarYear=,CalendarMonth=,CalendarQuarter=&amp;gt; }Cases)';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 May 2021 13:55:49 GMT</pubDate>
    <dc:creator>NickHoff</dc:creator>
    <dc:date>2021-05-25T13:55:49Z</dc:date>
    <item>
      <title>SET Variable in load script issue with $</title>
      <link>https://community.qlik.com/t5/QlikView/SET-Variable-in-load-script-issue-with/m-p/1809849#M1212478</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a slider in my application which can have a value of 1 - 24.&lt;/P&gt;&lt;P&gt;I'm attempting to use a SET variable in my load script to be loaded into a LET variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The slider is called vRunRate.&lt;/P&gt;&lt;P&gt;I'm attempting to pull the date in, which works when using the following expression:&lt;/P&gt;&lt;P&gt;(DATE(MonthStart(AddMonths(CurrentSelectionMonthYear,-$(vRunRate)+1,1)),'MMM-YYYY'))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if I attempt to use&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SET vCurrentPeriodStartDate = "(DATE(MonthStart(AddMonths(CurrentSelectionMonthYear,-$(vRunRate)+1,1)),'MMM-YYYY'))";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The value that SET stops at is the $ and $(vRunRate) is never calculated in the LET, so when I use the following LET it's contains no value as show in the screen share:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LET results.png" style="width: 879px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55493i74E2BD2E38DB5115/image-size/large?v=v2&amp;amp;px=999" role="button" title="LET results.png" alt="LET results.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is what my LET statement looks like:&lt;/P&gt;&lt;P&gt;LET eCasesCurrentPeriodRunRate = 'SUM({&amp;lt;CalendarMonthYear= {"&amp;gt;=$'&amp;amp;'(=$'&amp;amp;'(vCurrentPeriodStartDate))&amp;lt;=$'&amp;amp;'(=$'&amp;amp;'(vCurrentPeriodEndDate))"},CalendarYear=,CalendarMonth=,CalendarQuarter=&amp;gt; }Cases)';&lt;/P&gt;&lt;P&gt;How can I get the correct value to pass from the SET to the LET?&amp;nbsp; The problem isn't with my LET, it's exists in the SET and passing the $.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 18:44:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SET-Variable-in-load-script-issue-with/m-p/1809849#M1212478</guid>
      <dc:creator>NickHoff</dc:creator>
      <dc:date>2021-05-24T18:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: SET Variable in load script issue with $</title>
      <link>https://community.qlik.com/t5/QlikView/SET-Variable-in-load-script-issue-with/m-p/1809895#M1212487</link>
      <description>&lt;P&gt;I don't understand why you have a double dollar expansion in your second variable expression. In any case there's a dollar expansion in vCurrentPeriodStartDate&amp;nbsp; too that you need to deal with:&lt;/P&gt;&lt;P&gt;SET vCurrentPeriodStartDate = =DATE(MonthStart(AddMonths(CurrentSelectionMonthYear,-@(vRunRate)+1,1)),'MMM-YYYY');&lt;BR /&gt;LET vCurrentPeriodStartDate = Replace('$(vCurrentPeriodStartDate)','@','$');&lt;/P&gt;&lt;P&gt;LET eCasesCurrentPeriodRunRate = 'SUM({&amp;lt;CalendarMonthYear={"&amp;gt;=$' &amp;amp; '(vCurrentPeriodStartDate)&amp;lt;=$' &amp;amp; '(vCurrentPeriodEndDate)"},CalendarYear=,CalendarMonth=,CalendarQuarter= &amp;gt;}Cases)';&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 17:46:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SET-Variable-in-load-script-issue-with/m-p/1809895#M1212487</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2021-05-24T17:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: SET Variable in load script issue with $</title>
      <link>https://community.qlik.com/t5/QlikView/SET-Variable-in-load-script-issue-with/m-p/1810378#M1212546</link>
      <description>&lt;P&gt;Ok,&lt;/P&gt;&lt;P&gt;I was able to get it to work by using the replace on vCurrentPeriodStartDate as you suggested, but I still had to run the syntax for my LET statement above to get it to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the final solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SET vCurrentPeriodTempStartDate = "(DATE(MonthStart(AddMonths(CurrentSelectionMonthYear,-@(vRunRate)+1,1)),'MMM-YYYY'))";&lt;BR /&gt;LET vCurrentPeriodStartDate = Replace('$(vCurrentPeriodTempStartDate)','@','$');&lt;/P&gt;&lt;P&gt;LET eCasesCurrentPeriodRunRate = 'SUM({&amp;lt;CalendarMonthYear= {"&amp;gt;=$'&amp;amp;'(=$'&amp;amp;'(vCurrentPeriodStartDate))&amp;lt;=$'&amp;amp;'(=$'&amp;amp;'(vCurrentPeriodEndDate))"},CalendarYear=,CalendarMonth=,CalendarQuarter=&amp;gt; }Cases)';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 13:55:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SET-Variable-in-load-script-issue-with/m-p/1810378#M1212546</guid>
      <dc:creator>NickHoff</dc:creator>
      <dc:date>2021-05-25T13:55:49Z</dc:date>
    </item>
  </channel>
</rss>

