<?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 How do I reference two different states within the same expression? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856249#M658604</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I work for an eCommerce company and we are trying to clean up our product categories by seeing how many skus overlap between them. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do this, I created a table with: (inherited state)&lt;/P&gt;&lt;P&gt;CategoryID&lt;/P&gt;&lt;P&gt;CategoryName&lt;/P&gt;&lt;P&gt;COUNT(DISTINCT(SkuID) &lt;EM&gt;as Sku Count&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then an associated categories table: (alternate state)&lt;/P&gt;&lt;P&gt;CategoryName&lt;/P&gt;&lt;P&gt;Count(DISTINCT{&amp;lt;SkuID = p({$} SkuID)&amp;gt;} SkuID) &lt;EM&gt;as Skus In Common&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My next step is trying to see the proportion of Skus in Common compared to the original Sku Count from the first table, but I can't manage to make it work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions? &lt;/P&gt;&lt;P&gt;My alternate stats is called {AssociatedCategories}. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 May 2015 23:02:31 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-05-13T23:02:31Z</dc:date>
    <item>
      <title>How do I reference two different states within the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856249#M658604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I work for an eCommerce company and we are trying to clean up our product categories by seeing how many skus overlap between them. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do this, I created a table with: (inherited state)&lt;/P&gt;&lt;P&gt;CategoryID&lt;/P&gt;&lt;P&gt;CategoryName&lt;/P&gt;&lt;P&gt;COUNT(DISTINCT(SkuID) &lt;EM&gt;as Sku Count&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then an associated categories table: (alternate state)&lt;/P&gt;&lt;P&gt;CategoryName&lt;/P&gt;&lt;P&gt;Count(DISTINCT{&amp;lt;SkuID = p({$} SkuID)&amp;gt;} SkuID) &lt;EM&gt;as Skus In Common&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My next step is trying to see the proportion of Skus in Common compared to the original Sku Count from the first table, but I can't manage to make it work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions? &lt;/P&gt;&lt;P&gt;My alternate stats is called {AssociatedCategories}. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 23:02:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856249#M658604</guid>
      <dc:creator />
      <dc:date>2015-05-13T23:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I reference two different states within the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856250#M658605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/2963"&gt;Why Comparative Analysis&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 09:02:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856250#M658605</guid>
      <dc:creator>qlikviewwizard</dc:creator>
      <dc:date>2015-05-14T09:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I reference two different states within the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856251#M658606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrea,&lt;/P&gt;&lt;P&gt;The result of an Alternate state can be reffered to , inside a Set Expression,&lt;/P&gt;&lt;P&gt;For Eg. : here in your case(Not sure what your calculation is !)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum({[AssociatedCategories]&amp;lt;[Skus In Common]&amp;gt;}[SumField])&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;Cheers !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 09:26:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856251#M658606</guid>
      <dc:creator />
      <dc:date>2015-05-14T09:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I reference two different states within the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856252#M658607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just as you reference the inherited state by using the $ sign, you can reference the alternate state by its name.&lt;/P&gt;&lt;P&gt;You can use this for sets as well as individual fields within the same set expression e.g.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;Sum({AltSt1 &amp;lt;Region = $:: Region&amp;gt;} Sales)&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.3333330154419px;"&gt;Which means, take all selections from the Alternate state AltSt1 but take the selections for Region from the inherited state&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.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 09:29:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856252#M658607</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-05-14T09:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I reference two different states within the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856253#M658608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I feel like this is the correct answer, but it's not working and I'm not sure why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep in mind that I want to take the total count of skus in common, and divide it by the total number of skus possible.&lt;/P&gt;&lt;P&gt;So on the left hand side I have my inherited state - which shows the number of unique skus by category - and on the left I have another chart in an alternate state showing the number of skus in common with the left hand selection - and I want to get a proportion of the number of skus in common compared to the original sku count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The proportion right now is the one you gave me - any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Essentially I need to take Skus in Common (altstate) / Sku Count (inherited)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="86600" alt="Example.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/86600_Example.JPG" style="height: 517px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;This is the expression I used for the above result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Skus in Common]/COUNT({AssociatedCategories &amp;lt;SkuID= $::SkuID&amp;gt;}DISTINCT SkuID)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 16:12:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856253#M658608</guid>
      <dc:creator />
      <dc:date>2015-05-14T16:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I reference two different states within the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856254#M658609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure what is what in your above example and I'm not familiar with your data. However I think the problem is not with the states but with your dimensions and what you are dividing by. Can you try to divide &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;COUNT({AssociatedCategories &amp;lt;SkuID= $::SkuID&amp;gt;} TOTAL DISTINCT SkuID)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 11:48:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856254#M658609</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-05-15T11:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I reference two different states within the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856255#M658610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So this is definitely working better, only it is giving me the total distinct skuID overall, and not the currently selected category of SkuID's (from the inherited state). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 15:32:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856255#M658610</guid>
      <dc:creator />
      <dc:date>2015-05-15T15:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I reference two different states within the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856256#M658611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What&amp;nbsp; do you mean by "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; category of SkuID's", are there any selections in SkuID in the inherited state? Or do you have a category selected? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the set expression you only reference SkuID in inherited state, only actual selections in this field will be reflected, so e.g. not possible values implied by another selction&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2015 08:51:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-reference-two-different-states-within-the-same/m-p/856256#M658611</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-05-16T08:51:17Z</dc:date>
    </item>
  </channel>
</rss>

