<?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 Set analysis issue using variable. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330098#M1175769</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Can you post the table structure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I think its better if you link the Category and category groups internally by using same field name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Mar 2012 13:27:21 GMT</pubDate>
    <dc:creator>CELAMBARASAN</dc:creator>
    <dc:date>2012-03-30T13:27:21Z</dc:date>
    <item>
      <title>Set analysis issue using variable.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330096#M1175767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey everyone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ive just started using QV quite recently and while i enjoy it for the most part. And thank you very much everyone who replies to all these threads its much appreciated. &lt;/P&gt;&lt;P&gt;Some prior info, I have searched for and read just about everything i can find about set analysis to try solve this but hasnt helped.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My situation :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im using a List Box to Display Category Groups&lt;/P&gt;&lt;P&gt;and another Displaying Categories&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simplistic Example here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Group&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Category&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;One&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Red Apple&lt;/P&gt;&lt;P&gt;One&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Green Apple&lt;/P&gt;&lt;P&gt;Two&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Orange&lt;/P&gt;&lt;P&gt;Three&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Strawberry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So ive created a table similar to above. The first list box when selected will filter out results in listbox 2 simple stuff. Works great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now lets say i have another table which lists all transactions which has both Group and Category in each row. I dont want to link this data to these 2 seperate tables. So what i did was create a variable which would store whatever the current selection is, (if no Categories are selected for now ill just be keeping the graph blank so no stress there either). And what i want the graph to do, is to change depending on the selection. I can get this working with an IF but im trying to steer clear of them and learn Set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variable : vVar = GetfieldSelections(Category)&lt;/P&gt;&lt;P&gt;Graph Dimension : Justing using category for now&lt;/P&gt;&lt;P&gt;Graph Expression : =count({1&amp;lt;Category={"$vVar"}&amp;gt;}Category)&lt;/P&gt;&lt;P&gt;MAINCategory is the transaction table category which i would like to count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried replacing the graph expression with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =count({1&amp;lt;MAINCategory={'$vVar'}&amp;gt;}MAINCategory)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =count({1&amp;lt;MAINCategory={$vVar}&amp;gt;}MAINCategory)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the effort and replies in advance guys. I can probably make up an example of what im talking about but ill only get round to it next week if needed &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 12:50:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330096#M1175767</guid>
      <dc:creator />
      <dc:date>2012-03-30T12:50:58Z</dc:date>
    </item>
    <item>
      <title>Set analysis issue using variable.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330097#M1175768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this method&amp;nbsp; u get answer .i will thing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variable : vVar = '=GetfieldSelections(Category)'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({1&amp;lt;MAINCategory={'$(vVar)'}&amp;gt;}MAINCategory)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Perumal A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 13:11:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330097#M1175768</guid>
      <dc:creator>perumal_41</dc:creator>
      <dc:date>2012-03-30T13:11:36Z</dc:date>
    </item>
    <item>
      <title>Set analysis issue using variable.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330098#M1175769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Can you post the table structure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I think its better if you link the Category and category groups internally by using same field name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 13:27:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330098#M1175769</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-03-30T13:27:21Z</dc:date>
    </item>
    <item>
      <title>Set analysis issue using variable.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330099#M1175770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a particular reason for not associating the tables? If not, that would be faster and simpler than what you are trying to do. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming there is a reason, I don't think you need a variable to do this. Rather use the P() function in the set analysis. Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count({&amp;lt;MAINCategory=P(Category)&amp;gt;} MAINCategory)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will cause MAINCategory to be limited to the possible values of Category (if Category is one of the fields in the listboxes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you can't use Category as the dimension in the graph with set analysis. The set analysis is performed BEFORE the chart is constructed, so is unaware of the dimensions. In other words, the data passed to the chart already has the set analysis performed on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 14:04:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330099#M1175770</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-03-30T14:04:12Z</dc:date>
    </item>
    <item>
      <title>Set analysis issue using variable.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330100#M1175771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;Didnt work Perumal A. Thanks though i think thats something to remember for the future!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #eef4f9; color: #636363; font-family: Arial; font-size: 12px;"&gt;Hey Celambarasan, thanks for your reply linking them would be a good idea according to what I posted. I forgot to mention that im going to be using 2&amp;nbsp; graphs on a comparison sheet. I dont want either graphs selection/filters to affect the other. Thats why I used seperate tables to do the filtering off. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #eef4f9; color: #636363; font-family: Arial; font-size: 12px;"&gt;The problem is that my Set Analysis statement works if i input a text value instead of using the variable (ie use Red Apples) instead of vVar in the Set Statement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #eef4f9; color: #636363; font-family: Arial; font-size: 12px;"&gt;Thanks for the quick replies!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 14:24:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330100#M1175771</guid>
      <dc:creator />
      <dc:date>2012-03-30T14:24:33Z</dc:date>
    </item>
    <item>
      <title>Set analysis issue using variable.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330101#M1175772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Which version of qlikview are you using?&lt;/P&gt;&lt;P&gt;try like&lt;/P&gt;&lt;P&gt;Chnge your variable expression as = GetfieldSelections(Category,',')&lt;/P&gt;&lt;P&gt; =count({1&amp;lt;Category={$(vVar)}&amp;gt;}Category)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 14:34:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330101#M1175772</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-03-30T14:34:53Z</dc:date>
    </item>
    <item>
      <title>Set analysis issue using variable.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330102#M1175773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jonathan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using P in the set analysis seemed to do the trick!! I hope i dont get stuck with this kind of thing again though. Not sure why the variable wasnt getting accepted as is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry you were right about the dimension as well. I just made up the apples example as the data is a bit sensitive, i wasnt actually using category as the dimension &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2012 07:37:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-issue-using-variable/m-p/330102#M1175773</guid>
      <dc:creator />
      <dc:date>2012-04-02T07:37:25Z</dc:date>
    </item>
  </channel>
</rss>

