<?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 Storing Variable - GetFieldSelection? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147728#M26121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. Both suggestions worked. However, I'm having a bit of a problem calling the variable. For some reason the formula below does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;=Sum({$&amp;lt;UNIT_NUM={$(=subfield(vUNIT_ARRAY,',',1))},PM={'Y'}&amp;gt;}TOT_LABOR)/Production&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;However, when I put in the actual unit number the formula works(see below). I use =subfield(vUNIT_ARRAY),',',1) and it does display the right UNIT_NUM thus I can't figure out why the above statement does not work. It should be doing the exact same thing below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;=Sum({$&amp;lt;UNIT_NUM={'72960-120'},PM={'Y'}&amp;gt;}TOT_LABOR)/Production&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jun 2009 23:07:34 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-06-25T23:07:34Z</dc:date>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147723#M26116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have Department, and a list of trucks (Units) within that department.&lt;/P&gt;&lt;P&gt;I'm trying to store the list of trucks in a variable when the user selects that department. ie) select Department 'A', the variable will hold 'truck1,truck2,truck3' and so on.&lt;/P&gt;&lt;P&gt;Currently, I am using =GetFieldSelections (Units, ' , ', 30). However, if the user selects Department 'A' it does group the right truck, but since there are no trucks actually selected, nothing is being stored. I have to individually select the trucks for it to work.&lt;/P&gt;&lt;P&gt;I'm obviously not using the right command to do this &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; but I couldn't find anything in the helpfile to do what I desire.&lt;/P&gt;&lt;P&gt;Thus is there a way to store the list of Units in a variable, based on the Department selection?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2009 00:57:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147723#M26116</guid>
      <dc:creator />
      <dc:date>2009-06-25T00:57:23Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147724#M26117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't see a Get Field Possible Selections function either. I'm not sure if this can be done without macros.&lt;/P&gt;&lt;P&gt;It's easy with a macro. Set the OnSelect for your Department field to a macro. In the macro, you only need one line:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;ActiveDocument.Fields("Units").SelectPossible&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Then your GetFieldSelections command should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2009 01:07:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147724#M26117</guid>
      <dc:creator />
      <dc:date>2009-06-25T01:07:51Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147725#M26118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's Miller Time!!&lt;/P&gt;&lt;P&gt;Thanks, that worked like a charm.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2009 02:19:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147725#M26118</guid>
      <dc:creator />
      <dc:date>2009-06-25T02:19:35Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147726#M26119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's getting close. &lt;IMG alt="Big Smile" src="http://community.qlik.com/emoticons/emotion-2.gif" /&gt;&lt;/P&gt;&lt;P&gt;Glad to help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2009 02:21:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147726#M26119</guid>
      <dc:creator />
      <dc:date>2009-06-25T02:21:33Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147727#M26120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Chhai Sun wrote: I'm trying to store the list of trucks in a variable when the user selects that department. ie) select Department 'A', the variable will hold 'truck1,truck2,truck3' and so on.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;You can get the list into a qlikview variable by defining the variable as:&lt;/P&gt;&lt;P&gt;=concat(Units, ',')&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2009 02:46:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147727#M26120</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-06-25T02:46:20Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147728#M26121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. Both suggestions worked. However, I'm having a bit of a problem calling the variable. For some reason the formula below does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;=Sum({$&amp;lt;UNIT_NUM={$(=subfield(vUNIT_ARRAY,',',1))},PM={'Y'}&amp;gt;}TOT_LABOR)/Production&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;However, when I put in the actual unit number the formula works(see below). I use =subfield(vUNIT_ARRAY),',',1) and it does display the right UNIT_NUM thus I can't figure out why the above statement does not work. It should be doing the exact same thing below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;=Sum({$&amp;lt;UNIT_NUM={'72960-120'},PM={'Y'}&amp;gt;}TOT_LABOR)/Production&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2009 23:07:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147728#M26121</guid>
      <dc:creator />
      <dc:date>2009-06-25T23:07:34Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147729#M26122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've always put the variable inside a dollar sign expansion. In yours, the variable is part of a larger dollar sign expansion. Could you try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=Sum({$&amp;lt;UNIT_NUM={$(=subfield($(vUNIT_ARRAY),',',1))},PM={'Y'}&amp;gt;}TOT_LABOR)/Production&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Does putting a dollar sign expansion inside a dollar sign expansion cause a tear in the space time continuum? &lt;IMG alt="Wink" src="http://community.qlik.com/emoticons/emotion-5.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2009 23:19:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147729#M26122</guid>
      <dc:creator />
      <dc:date>2009-06-25T23:19:30Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147730#M26123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried that but no change on the space-time continuum since I'm getting the same result &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I wonder who would be able to solve this faster, Data or Chekov &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 01:25:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147730#M26123</guid>
      <dc:creator />
      <dc:date>2009-06-26T01:25:35Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147731#M26124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have that Expression in a chart? I just noticed a good way to check how your dollar sign expansion is working. Use a straight table and add the expression. Don't label the expression, keep it as &amp;lt;use expression&amp;gt;. Then when the table is rendered, the label for that expression will be the expression after the dollar sign expansion is evaluated. For yours, you may need to wrap the headers to a few lines to see it all. That may allow you to see how your dollar sign expansion is working.&lt;/P&gt;&lt;P&gt;Since the subfield expression works on its own, I'm guessing there is a problem in that portion of the larger expression.&lt;/P&gt;&lt;P&gt;EDIT: On second thought, I don't know what could be wrong. I just tested out the subfield function using a variable inside a dollar sign expansion and it worked as expected.&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum( {1&amp;lt;Company = {$(=Subfield(vSel, ',', 1))}&amp;gt;} Amount)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 01:41:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147731#M26124</guid>
      <dc:creator />
      <dc:date>2009-06-26T01:41:17Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147732#M26125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;NMiller wrote:I just noticed a good way to check how your dollar sign expansion is working. Use a straight table and add the expression. Don't label the expression, keep it as &amp;lt;use expression&amp;gt;. Then when the table is rendered, the label for that expression will be the expression after the dollar sign expansion is evaluated. For yours, you may need to wrap the headers to a few lines to see it all. That may allow you to see how your dollar sign expansion is working.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Yep. I do that all the time. It's a good debugging tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 01:49:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147732#M26125</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-06-26T01:49:20Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147733#M26126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of continually editing my post, I'll make a new one. &lt;IMG alt="Smile" src="http://community.qlik.com/emoticons/emotion-1.gif" /&gt;&lt;/P&gt;&lt;P&gt;I think what is happening is your vUnit_Array value is being evaluated as an expression. i.e. 72960-120 = 72840. Since none of your UNIT_VALs are 72840, you are getting nothing.&lt;/P&gt;&lt;P&gt;The expression seems to allow quotes around the dollar sign expansion. Try this:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=Sum({$&amp;lt;UNIT_NUM={'$(=subfield(vUNIT_ARRAY,',',1))'},PM={'Y'}&amp;gt;}TOT_LABOR)/Production&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 01:53:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147733#M26126</guid>
      <dc:creator />
      <dc:date>2009-06-26T01:53:08Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147734#M26127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Miller (aka number one),&lt;/P&gt;&lt;P&gt;thanks a lot. You must of passed Star Fleet Academy no problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 02:14:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147734#M26127</guid>
      <dc:creator />
      <dc:date>2009-06-26T02:14:43Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147735#M26128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Miller (aka number one),&lt;/P&gt;&lt;P&gt;thanks a lot. You must of passed Star Fleet Academy no problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 02:14:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147735#M26128</guid>
      <dc:creator />
      <dc:date>2009-06-26T02:14:47Z</dc:date>
    </item>
    <item>
      <title>Storing Variable - GetFieldSelection?</title>
      <link>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147736#M26129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope, I flunked out for spending too much time on the Internet! &lt;IMG alt="Wink" src="http://community.qlik.com/emoticons/emotion-5.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 02:36:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Storing-Variable-GetFieldSelection/m-p/147736#M26129</guid>
      <dc:creator />
      <dc:date>2009-06-26T02:36:05Z</dc:date>
    </item>
  </channel>
</rss>

