<?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 Can a variable be used in a Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Can-a-variable-be-used-in-a-Set-Analysis/m-p/148182#M505245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of using a variable you should be able to use a field containing the name of the field to summarize.&lt;/P&gt;&lt;P&gt;i.e. you have a field called MyFieldName where the value is MyField ok ?&lt;/P&gt;&lt;P&gt;Then in your expression you put SUM({$&amp;lt;InvoiceYear={$(=Only(InvoiceYear_1)},InvoiceMonth={"&amp;lt;=$(=max(InvoiceMonth))"}&amp;gt;} $(=only(MyFieldName))).&lt;/P&gt;&lt;P&gt;This will work ( in this case I advise that you mandatory always one value selected for the field MyFieldName.&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sébastien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jul 2009 21:43:15 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-07-01T21:43:15Z</dc:date>
    <item>
      <title>Can a variable be used in a Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Can-a-variable-be-used-in-a-Set-Analysis/m-p/148180#M505243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This variable is working: &lt;B&gt;$(CM)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;But when putting it in a Set Analysis it doesn't:&lt;/P&gt;&lt;P&gt;sum&lt;/P&gt;&lt;P&gt;({$&amp;lt;InvoiceYear={&lt;B&gt;&lt;I&gt;$(=Only(InvoiceYear)-1)&lt;/I&gt;&lt;/B&gt;}&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;InvoiceMonth={"&amp;lt;=$(=max(InvoiceMonth))"}&lt;/P&gt;&lt;P&gt;&amp;gt;}&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;B&gt;$(CM)&lt;/B&gt;)&lt;/P&gt;&lt;P&gt;The result is "-"&lt;/P&gt;&lt;P&gt;I have also tried to take the formula from the variable (which is 2 other variables) and copied this in instead of the $(CM) - No result.&lt;/P&gt;&lt;P&gt;Thanks in advance for your help&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 19:12:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-a-variable-be-used-in-a-Set-Analysis/m-p/148180#M505243</guid>
      <dc:creator>johnlauridsen</dc:creator>
      <dc:date>2009-07-01T19:12:15Z</dc:date>
    </item>
    <item>
      <title>Can a variable be used in a Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Can-a-variable-be-used-in-a-Set-Analysis/m-p/148181#M505244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Set analysis doesn't apply to variables - any more than Sum, Avg, Count do!&lt;/P&gt;&lt;P&gt;Your variable will have a value - e.g. CM = 5. A sum statement like this:&lt;/P&gt;&lt;P&gt;Sum(CM) or Sum($(CM)) {both are equivalent}&lt;/P&gt;&lt;P&gt;is actually saying:&lt;/P&gt;&lt;P&gt;Sum(5)&lt;/P&gt;&lt;P&gt;It doesn't make any sense.&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;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 19:35:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-a-variable-be-used-in-a-Set-Analysis/m-p/148181#M505244</guid>
      <dc:creator>stephencredmond</dc:creator>
      <dc:date>2009-07-01T19:35:47Z</dc:date>
    </item>
    <item>
      <title>Can a variable be used in a Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Can-a-variable-be-used-in-a-Set-Analysis/m-p/148182#M505245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of using a variable you should be able to use a field containing the name of the field to summarize.&lt;/P&gt;&lt;P&gt;i.e. you have a field called MyFieldName where the value is MyField ok ?&lt;/P&gt;&lt;P&gt;Then in your expression you put SUM({$&amp;lt;InvoiceYear={$(=Only(InvoiceYear_1)},InvoiceMonth={"&amp;lt;=$(=max(InvoiceMonth))"}&amp;gt;} $(=only(MyFieldName))).&lt;/P&gt;&lt;P&gt;This will work ( in this case I advise that you mandatory always one value selected for the field MyFieldName.&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sébastien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 21:43:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-a-variable-be-used-in-a-Set-Analysis/m-p/148182#M505245</guid>
      <dc:creator />
      <dc:date>2009-07-01T21:43:15Z</dc:date>
    </item>
    <item>
      <title>Can a variable be used in a Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Can-a-variable-be-used-in-a-Set-Analysis/m-p/148183#M505246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the definition of your variable? You said it was made up of other variables, could you post the definitions of those.&lt;/P&gt;&lt;P&gt;You can use a variable in the context you describe. If your variable contains an expression, then that expression would be evaluated as part of the Sum.&lt;/P&gt;&lt;P&gt;Also, have you tried removing the Set Analysis portion to see if that is at fault? If your expression works, Sum($(CM)) should give results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 21:44:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-a-variable-be-used-in-a-Set-Analysis/m-p/148183#M505246</guid>
      <dc:creator />
      <dc:date>2009-07-01T21:44:32Z</dc:date>
    </item>
  </channel>
</rss>

