<?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: Using Variable to call Field Name based on ListBox Selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Variable-to-call-Field-Name-based-on-ListBox-Selection/m-p/1069151#M357226</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to put the division by 12 outside the dollar sign expansion of the variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;=(sum({$&amp;lt;YTD_Flag =&amp;gt;} &lt;STRONG&gt;$(vCrushing)/12&lt;/STRONG&gt;)*Num(max(Month))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;edit:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Also double check e.g. by leaving the expression label empty and then inspecting the expression header in the table, that the expression &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt; with the dollar sign expansion executed &lt;/SPAN&gt;looks exactely like your original expression without variable&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Mar 2016 18:43:29 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-03-24T18:43:29Z</dc:date>
    <item>
      <title>Using Variable to call Field Name based on ListBox Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-to-call-Field-Name-based-on-ListBox-Selection/m-p/1069150#M357225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am fairly new to Qlikview and am having an issue with a business requirement. I have found a lot of great information through this community but can't seem to work out this one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a listbox with years, 2012, 2013, 2014, 2015, 2016 from field [Year]&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I have a straight table that displays sales targets for several products one year at a time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Based on the year selected, I want to use the Field with the targets for that particular year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I have the below Variables&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;vYear = GetFieldSelections(Year)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;vCrushing =if(WildMatch(vYear, '*2016*', CrushingTGT2016, if(WildMatch(vYear, '*2015*', CrushingTGT2015, if(WildMatch(vYear,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '*2014*', CrushingTGT2014, if(WildMatch(vYear, '*2013*', CrushingTGT2013, if(WildMatch(vYear, '*2012*', CrushingTGT2012, 'OTHER')))))&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;The formula on the straight table is =(sum({$&amp;lt;YTD_Flag =&amp;gt;} $(vCrushing/12))*Num(max(Month))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Each of the TGT values are separate fields on an Excel spreadsheet&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;The idea is that when a Year is selected, the variable vCrushing will set the correct field in the formula thus displaying targets for specified year.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;The formula works fine if I call the field directly but when introducing the variable to the mix it no longer works. Can a variable be used to call a field name and then, use that field name in a formula dynamically?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2016 18:12:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-to-call-Field-Name-based-on-ListBox-Selection/m-p/1069150#M357225</guid>
      <dc:creator />
      <dc:date>2016-03-24T18:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable to call Field Name based on ListBox Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-to-call-Field-Name-based-on-ListBox-Selection/m-p/1069151#M357226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to put the division by 12 outside the dollar sign expansion of the variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;=(sum({$&amp;lt;YTD_Flag =&amp;gt;} &lt;STRONG&gt;$(vCrushing)/12&lt;/STRONG&gt;)*Num(max(Month))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;edit:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Also double check e.g. by leaving the expression label empty and then inspecting the expression header in the table, that the expression &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt; with the dollar sign expansion executed &lt;/SPAN&gt;looks exactely like your original expression without variable&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2016 18:43:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-to-call-Field-Name-based-on-ListBox-Selection/m-p/1069151#M357226</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-24T18:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable to call Field Name based on ListBox Selection</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-to-call-Field-Name-based-on-ListBox-Selection/m-p/1069152#M357227</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;maybe you should reconsider your data model as well.&lt;/P&gt;&lt;P&gt;Try crosstable loading your &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;CrushingTGT* fields to get the actual &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;CrushingTGT values and a &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;CrushingTGTYear field.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;This might simplify your application and render your &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;vCrushing variable obsolete.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2016 02:22:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-to-call-Field-Name-based-on-ListBox-Selection/m-p/1069152#M357227</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2016-03-25T02:22:52Z</dc:date>
    </item>
  </channel>
</rss>

