<?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 Parameters to variable with alternate states in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Parameters-to-variable-with-alternate-states/m-p/795777#M281130</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm trying to create a variable that I can use for computations either with or without alternate states.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I have come up with the following (vSales):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14273585350645733" jivemacro_uid="_14273585350645733"&gt;
&lt;P&gt;If(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $1=Null(),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Sum(Sales),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Sum({$1} Sales )&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The thing is that it seems to work when I supply the state names. However, it messes up the charts where I have a drill-down group but where I don't use alternate states. When I click on the chart where I don't supply alternate state names to the variable I don't drill down to the next level but rather get to see everything, also stuff that does not belong to that group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that drill-down groups don't work with alternate states but I had thought the variable expression I have should not care about that when I supply $(vSales()) to the chart because it does not contain a reference to an alternate state in the set analysis. The charts where I write $(vSales(State1)) seem OK although I have not done detailed validation because I cannot get past this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could create variables for each state but I find that to defeat the purpose of having all computation details tucked neatly into variables. The code would be identical except for the set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I cannot send my QlikView file because it contains sensitive data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Mar 2015 08:34:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-03-26T08:34:38Z</dc:date>
    <item>
      <title>Parameters to variable with alternate states</title>
      <link>https://community.qlik.com/t5/QlikView/Parameters-to-variable-with-alternate-states/m-p/795777#M281130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm trying to create a variable that I can use for computations either with or without alternate states.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I have come up with the following (vSales):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14273585350645733" jivemacro_uid="_14273585350645733"&gt;
&lt;P&gt;If(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $1=Null(),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Sum(Sales),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Sum({$1} Sales )&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The thing is that it seems to work when I supply the state names. However, it messes up the charts where I have a drill-down group but where I don't use alternate states. When I click on the chart where I don't supply alternate state names to the variable I don't drill down to the next level but rather get to see everything, also stuff that does not belong to that group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that drill-down groups don't work with alternate states but I had thought the variable expression I have should not care about that when I supply $(vSales()) to the chart because it does not contain a reference to an alternate state in the set analysis. The charts where I write $(vSales(State1)) seem OK although I have not done detailed validation because I cannot get past this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could create variables for each state but I find that to defeat the purpose of having all computation details tucked neatly into variables. The code would be identical except for the set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I cannot send my QlikView file because it contains sensitive data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 08:34:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Parameters-to-variable-with-alternate-states/m-p/795777#M281130</guid>
      <dc:creator />
      <dc:date>2015-03-26T08:34:38Z</dc:date>
    </item>
  </channel>
</rss>

