<?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: Set analysis and if conditions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-if-conditions/m-p/643867#M235907</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set analysis will not help you here. Set analysis is in principle like a selection that is made for that expression only, and is evaluated before the expression is calculated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case, you have a data model with two unconnected tables that looks like &lt;/P&gt;&lt;P&gt;&lt;IMG alt="Image1.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/59439_Image1.png" /&gt;&lt;/P&gt;&lt;P&gt;and then you use an if function in the scatter chart to create a link between S_ID and the right number in the left table. This type of logic is exactly what QlikView is good at. So I would instead build this logic into the data model:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Crosstable (S_ID, number,2)&lt;/P&gt;&lt;P&gt;LOAD id, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number_1, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number_2, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number_3, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number_4, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number_5&lt;/P&gt;&lt;P&gt;FROM scatterplot_issue.txt&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Name, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'number_' &amp;amp; S_ID as S_ID&lt;/P&gt;&lt;P&gt;FROM Selection.txt ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then you need to change your scatter chart to use the following two expressions instead:&lt;/P&gt;&lt;P&gt;Expr1: Avg(number)&lt;/P&gt;&lt;P&gt;Expr2: Avg(number_1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 May 2014 09:21:08 GMT</pubDate>
    <dc:creator>hic</dc:creator>
    <dc:date>2014-05-23T09:21:08Z</dc:date>
    <item>
      <title>Set analysis and if conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-if-conditions/m-p/643866#M235906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've read that using set analysis can perform much faster than conditional if statements. I have a scatterplot chart that uses one dimension with 2 expressions - one expression is a field - the other expression is conditional based on what is selected in a listbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attaching an example where I am using a conditional statement for one of the expressions in the scatterplot based on the selection in the listbox. How would I use set analysis for this example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this conditional expression in a variety of places on my application and want try to make the rendering of these charts and objects faster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2014 17:59:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-and-if-conditions/m-p/643866#M235906</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-22T17:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis and if conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-if-conditions/m-p/643867#M235907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set analysis will not help you here. Set analysis is in principle like a selection that is made for that expression only, and is evaluated before the expression is calculated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case, you have a data model with two unconnected tables that looks like &lt;/P&gt;&lt;P&gt;&lt;IMG alt="Image1.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/59439_Image1.png" /&gt;&lt;/P&gt;&lt;P&gt;and then you use an if function in the scatter chart to create a link between S_ID and the right number in the left table. This type of logic is exactly what QlikView is good at. So I would instead build this logic into the data model:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Crosstable (S_ID, number,2)&lt;/P&gt;&lt;P&gt;LOAD id, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number_1, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number_2, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number_3, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number_4, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number_5&lt;/P&gt;&lt;P&gt;FROM scatterplot_issue.txt&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Name, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'number_' &amp;amp; S_ID as S_ID&lt;/P&gt;&lt;P&gt;FROM Selection.txt ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then you need to change your scatter chart to use the following two expressions instead:&lt;/P&gt;&lt;P&gt;Expr1: Avg(number)&lt;/P&gt;&lt;P&gt;Expr2: Avg(number_1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2014 09:21:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-and-if-conditions/m-p/643867#M235907</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2014-05-23T09:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis and if conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-if-conditions/m-p/643868#M235908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Carry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i can see, that your selection defines rather expression (column) than data set to process.&lt;/P&gt;&lt;P&gt;Of course you may do as Henric suggested.&lt;/P&gt;&lt;P&gt;Anyway, especially if you have large volumes it may be better to still have 5 columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may consider to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pick(S_ID, number_1,number_2,number_3,....) instead your nested if.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2014 13:27:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-and-if-conditions/m-p/643868#M235908</guid>
      <dc:creator />
      <dc:date>2014-05-23T13:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis and if conditions</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-and-if-conditions/m-p/643869#M235909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did try the suggestion you made, Henric - but saw no difference in performance on my application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Darek, is the pick() function better for performance than loading all of the data as Henric suggested?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my main table has a lot of other attributes for the id and I would probably not want to use crosstable for the whole thing as it would generate a lot of extra data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cary&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2014 14:07:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-and-if-conditions/m-p/643869#M235909</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-05-23T14:07:29Z</dc:date>
    </item>
  </channel>
</rss>

