<?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: Variables from an external File: Trouble with referencing variables within a variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496067#M686615</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pretty sure I am Nils, as the LET statements are working as I am intending, which means each time I load, they hard code a value into the variable, and not a formula. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Dec 2013 15:42:11 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-12-17T15:42:11Z</dc:date>
    <item>
      <title>Variables from an external File: Trouble with referencing variables within a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496063#M686611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I’m attempting to load all of my Variables from an external file. Basically to make sure all developers are defining their kpi’s in the same way. I’ve created a text file, which I’ve stored my variables, and I am loading them via an INCLUDE statement in the Qlikview script. &lt;/P&gt;&lt;P&gt;Here is a sample of my Variable Txt file:&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;LET vCalendarYrCY=NUM(YEAR(Today()));&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;LET vCurrentSY_Y= NUM(IF (Month(Today())&amp;gt;= 9,YEAR(Today())+1,Year(Today())));&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;SET vMostRecentSnapshotDate=DATE(MAX({&amp;lt;SalesYear_Year={'$(vCalendarYrCY)'}&amp;gt;} SnapshotDate), 'YYYY-MM-DD');&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;SET v_SDNow_SYCurr_NetAC=&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT({$&amp;lt;ps_NetAC={'&amp;gt;0'}&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , SOStatusCode={'AC','TR'}&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , SalesOp_TransportMode={'BUS','AIR'}&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,SnapshotDate={'$(vMostRecentSnapshotDate)'}&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,SalesYear_Year={$(vCurrentSY_Y)}&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;}DISTINCT SalesOp_id);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of these load into the document , &lt;STRONG&gt;&lt;EM&gt;vCalendarYrCY&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; &lt;/EM&gt;and&amp;nbsp; &lt;STRONG&gt;&lt;EM&gt;vMostRecentSnapshotDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; &lt;/EM&gt;load exactly as I intended. My issue comes in to play when I attempt to reference &lt;STRONG&gt;&lt;EM&gt;vMostRecentSnapshotDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; &lt;/EM&gt;in the next variable &lt;STRONG&gt;&lt;EM&gt;v_SDNow_SYCurr_NetAC&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;. &lt;/EM&gt;For some reason it refuses to pass exactly as it is written and instead passes this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;COUNT({$&amp;lt;ps_NetAC={'&amp;gt;0'}&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , SOStatusCode={'AC','TR'}&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , SalesOp_TransportMode={'BUS','AIR'}&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,SnapshotDate={' DATE(MAX({&amp;lt;SalesYear_Year={'$(vCalendarYrCY)'}&amp;gt;} SnapshotDate), 'YYYY-MM-DD')'}&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,SalesYear_Year={2014}&lt;/EM&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;}DISTINCT SalesOp_id);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This of course does not work, and defeats the purpose of using an external file to Load the variables, as the user will now have to go in and change &lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SnapshotDate={' DATE(MAX({&amp;lt;SalesYear_Year={'$(vCalendarYrCY)'}&amp;gt;} SnapshotDate), 'YYYY-MM-DD')'}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;To&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SnapshotDate={'$(vMostRecentSnapshotDate)'}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;In every area that this variable is referenced. I have tried several things, I have removed quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SnapshotDate={$(vMostRecentSnapshotDate)}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Tried double quotes&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SnapshotDate={“$(vMostRecentSnapshotDate)”}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neither of these accomplished what I need to happen. Has anyone run into this? If so have you found a workaround? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 15:21:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496063#M686611</guid>
      <dc:creator />
      <dc:date>2013-12-17T15:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Variables from an external File: Trouble with referencing variables within a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496064#M686612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 45px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-family: inherit;"&gt;LET vCurrentSY_Y= NUM(IF (Month(Today())&amp;gt;= 9,YEAR(Today())+1,Year(Today())));&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 45px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 45px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-family: inherit;"&gt;changed the $ to @. Just to confuse Qlikview &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 45px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-family: inherit;"&gt;SET vMostRecentSnapshotDate=DATE(MAX({&amp;lt;SalesYear_Year={'@(vCalendarYrCY)'}&amp;gt;} SnapshotDate), 'YYYY-MM-DD');&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 45px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 45px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-family: inherit;"&gt;then use Replace function to &lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 45px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 45px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM style="font-family: inherit;"&gt;LET &lt;EM style="color: #3d3d3d; font-family: inherit;"&gt;vMostRecentSnapshotDate&lt;/EM&gt; = Replace (&lt;EM style="color: #3d3d3d; font-family: inherit;"&gt;vMostRecentSnapshotDate&lt;/EM&gt;, '@', '$'&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 15:28:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496064#M686612</guid>
      <dc:creator />
      <dc:date>2013-12-17T15:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Variables from an external File: Trouble with referencing variables within a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496065#M686613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm, I might be missing something here but are you sure you are using set and let correctly?&lt;/P&gt;&lt;P&gt;Again I just briefly glanced at you variables. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 15:33:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496065#M686613</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-17T15:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Variables from an external File: Trouble with referencing variables within a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496066#M686614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Definitely works, I'm wondering if there is a less labor intensive way as I am dealing with 100's of variables, but this can definitely solve my issue! Thanks Sudheer! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 15:40:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496066#M686614</guid>
      <dc:creator />
      <dc:date>2013-12-17T15:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Variables from an external File: Trouble with referencing variables within a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496067#M686615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pretty sure I am Nils, as the LET statements are working as I am intending, which means each time I load, they hard code a value into the variable, and not a formula. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 15:42:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496067#M686615</guid>
      <dc:creator />
      <dc:date>2013-12-17T15:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Variables from an external File: Trouble with referencing variables within a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496068#M686616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I see now. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 15:47:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-from-an-external-File-Trouble-with-referencing/m-p/496068#M686616</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-17T15:47:14Z</dc:date>
    </item>
  </channel>
</rss>

