<?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 Based on variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Based-on-variable/m-p/141834#M21431</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Daniel and Oleg,&lt;/P&gt;&lt;P&gt;The solution is in using LET instead of SET. LET evaluates so technically the statements should be:&lt;/P&gt;&lt;P&gt;set vCol = 'ColA';&lt;BR /&gt;let vBCol = 'B' &amp;amp; '$(vCol)';&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Apr 2009 22:00:15 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-04-20T22:00:15Z</dc:date>
    <item>
      <title>Based on variable</title>
      <link>https://community.qlik.com/t5/QlikView/Based-on-variable/m-p/141831#M21428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I have a table where the the columns are actual and budget figures, where the names of the budget columns are that of the actuals but with the prefix 'B'. I try to create a variable based on that of another but I can't reference the contents correctly. This example should show the problem where the value of 'BValue' is 'BColA' rather than 101,124,121,105 I am trying to achieve:&lt;/P&gt;&lt;P&gt;test1:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; ColA, ColB, ColC, BColA, BColB, BColC&lt;BR /&gt; 12, 15, 18, 101, 108, 114&lt;BR /&gt; 25, 20, 17, 124, 122, 106&lt;BR /&gt; 1, 29, 5, 121, 120, 117&lt;BR /&gt; 6, 7, 11, 105, 108, 107&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;set vCol = 'ColA';&lt;BR /&gt;set vBCol = 'B' &amp;amp; '$(vCol)';&lt;BR /&gt;test2:&lt;BR /&gt;load recno() as recno,&lt;BR /&gt; $(vCol) as value,&lt;BR /&gt; $(vBCol) as BValue&lt;BR /&gt;resident test1;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 20:43:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Based-on-variable/m-p/141831#M21428</guid>
      <dc:creator />
      <dc:date>2009-04-20T20:43:39Z</dc:date>
    </item>
    <item>
      <title>Based on variable</title>
      <link>https://community.qlik.com/t5/QlikView/Based-on-variable/m-p/141832#M21429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe you should use let instead of set for it to work.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let&lt;/STRONG&gt; vCol = 'ColA';&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let&lt;/STRONG&gt; vBCol = 'B' &amp;amp; '$(vCol)';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 20:49:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Based-on-variable/m-p/141832#M21429</guid>
      <dc:creator>danielrozental</dc:creator>
      <dc:date>2009-04-20T20:49:53Z</dc:date>
    </item>
    <item>
      <title>Based on variable</title>
      <link>https://community.qlik.com/t5/QlikView/Based-on-variable/m-p/141833#M21430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, Set is what we typically use for storing expressions that will be evaluated later...&lt;/P&gt;&lt;P&gt;I'm puzzled - in my mind, your syntax should work... I got the expected result with the following:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;set vCol = 'ColA';&lt;BR /&gt;set vBCol = B$(vCol);&lt;/P&gt;&lt;P&gt;I also got the expected result using LET:&lt;/P&gt;&lt;P&gt;let vCol = 'ColA';&lt;BR /&gt;let vBCol = 'B' &amp;amp; '$(vCol)';&lt;/P&gt;&lt;P&gt;I still can't explain why this one works, and the other one doesn't...&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 21:12:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Based-on-variable/m-p/141833#M21430</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-04-20T21:12:25Z</dc:date>
    </item>
    <item>
      <title>Based on variable</title>
      <link>https://community.qlik.com/t5/QlikView/Based-on-variable/m-p/141834#M21431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Daniel and Oleg,&lt;/P&gt;&lt;P&gt;The solution is in using LET instead of SET. LET evaluates so technically the statements should be:&lt;/P&gt;&lt;P&gt;set vCol = 'ColA';&lt;BR /&gt;let vBCol = 'B' &amp;amp; '$(vCol)';&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2009 22:00:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Based-on-variable/m-p/141834#M21431</guid>
      <dc:creator />
      <dc:date>2009-04-20T22:00:15Z</dc:date>
    </item>
  </channel>
</rss>

