<?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: Alternate States - Set Aanalysis, no value selected in alternate state in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Alternate-States-Set-Aanalysis-no-value-selected-in-alternate/m-p/1996775#M82552</link>
    <description>&lt;P&gt;Hi Josh,&lt;/P&gt;
&lt;P&gt;The issue is in a subtle difference between the two syntax formats:&lt;/P&gt;
&lt;P&gt;Field = Set::Field&lt;/P&gt;
&lt;P&gt;vs.&lt;/P&gt;
&lt;P&gt;Field = P({Set} Field)&lt;/P&gt;
&lt;P&gt;The first format refers to the &lt;EM&gt;&lt;STRONG&gt;selected values&lt;/STRONG&gt;&lt;/EM&gt; in the field. The second format refers to the &lt;EM&gt;&lt;STRONG&gt;possible values&lt;/STRONG&gt;&lt;/EM&gt; in the field.&amp;nbsp; For your purpose, you need to use the second format to get all possible values of Products from the Alternate State, so your expression should look like this:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;count({&amp;lt;CID=P({&amp;lt;Product=P({&amp;lt;[ALT State]&amp;gt;})&amp;gt;}) &amp;gt;}&amp;nbsp; &amp;nbsp; distinct CID)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope I didn't miss any brackets on the way, since I'm typing it here from memory...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To learn more advanced development techniques, including advanced Set Analysis, AGGR(), Alternate States, data modeling, performance, scripting, and more - join us at the &lt;A href="https://masterssummit.com" target="_blank" rel="noopener"&gt;Masters Summit for Qlik&lt;/A&gt; in New Orleans on November 14-16. This is a once-a-year event, not to be missed!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2022 19:25:26 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2022-10-25T19:25:26Z</dc:date>
    <item>
      <title>Alternate States - Set Aanalysis, no value selected in alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Alternate-States-Set-Aanalysis-no-value-selected-in-alternate/m-p/1996764#M82551</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using an alternate state and want to filter in set analysis to the possible customer ids (CID) for the selected field in the alternate state:&lt;/P&gt;
&lt;P&gt;count({&amp;lt;CID=P({&amp;lt;Product=[ALT State]::Product&amp;gt;})&amp;gt;}distinct CID)&lt;/P&gt;
&lt;P&gt;I need this to be at the CID level because the data is laid out as multiple rows for a customer with a product on each row.&amp;nbsp; In my chart I want to see the count of customers for all products that have a customer with the product selected in the alternate state.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above works perfect if a product is selected in the alternate state.&amp;nbsp; If a product is not selected, I want to see the values for all customers.&amp;nbsp; When a value is not selected from the alternate state, nothing is brought back in the set.&amp;nbsp; Is there some way that I can do this without an if statement outside the set analysis to check on the count of selected products?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;Josh&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 18:54:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Alternate-States-Set-Aanalysis-no-value-selected-in-alternate/m-p/1996764#M82551</guid>
      <dc:creator>joshabbott</dc:creator>
      <dc:date>2022-10-25T18:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Alternate States - Set Aanalysis, no value selected in alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Alternate-States-Set-Aanalysis-no-value-selected-in-alternate/m-p/1996775#M82552</link>
      <description>&lt;P&gt;Hi Josh,&lt;/P&gt;
&lt;P&gt;The issue is in a subtle difference between the two syntax formats:&lt;/P&gt;
&lt;P&gt;Field = Set::Field&lt;/P&gt;
&lt;P&gt;vs.&lt;/P&gt;
&lt;P&gt;Field = P({Set} Field)&lt;/P&gt;
&lt;P&gt;The first format refers to the &lt;EM&gt;&lt;STRONG&gt;selected values&lt;/STRONG&gt;&lt;/EM&gt; in the field. The second format refers to the &lt;EM&gt;&lt;STRONG&gt;possible values&lt;/STRONG&gt;&lt;/EM&gt; in the field.&amp;nbsp; For your purpose, you need to use the second format to get all possible values of Products from the Alternate State, so your expression should look like this:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;count({&amp;lt;CID=P({&amp;lt;Product=P({&amp;lt;[ALT State]&amp;gt;})&amp;gt;}) &amp;gt;}&amp;nbsp; &amp;nbsp; distinct CID)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope I didn't miss any brackets on the way, since I'm typing it here from memory...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To learn more advanced development techniques, including advanced Set Analysis, AGGR(), Alternate States, data modeling, performance, scripting, and more - join us at the &lt;A href="https://masterssummit.com" target="_blank" rel="noopener"&gt;Masters Summit for Qlik&lt;/A&gt; in New Orleans on November 14-16. This is a once-a-year event, not to be missed!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 19:25:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Alternate-States-Set-Aanalysis-no-value-selected-in-alternate/m-p/1996775#M82552</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2022-10-25T19:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Alternate States - Set Aanalysis, no value selected in alternate state</title>
      <link>https://community.qlik.com/t5/App-Development/Alternate-States-Set-Aanalysis-no-value-selected-in-alternate/m-p/1996780#M82553</link>
      <description>&lt;P&gt;Brilliant, thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 19:34:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Alternate-States-Set-Aanalysis-no-value-selected-in-alternate/m-p/1996780#M82553</guid>
      <dc:creator>joshabbott</dc:creator>
      <dc:date>2022-10-25T19:34:03Z</dc:date>
    </item>
  </channel>
</rss>

