<?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 Suggest Set Analysis for 'IF Statement' in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219609#M500014</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It's difficult to me to understand how set analysis performs poorer than an If() expression, anyway not knowing the datamodel, I think that everything is possible.&lt;/P&gt;&lt;P&gt;But if it's not working as expected, there's likely an issue with date formatting or data modelling, because the expression above is the tipical example when selecting a date between a range of dates.&lt;/P&gt;&lt;P&gt;I don't dare to go any further without a better understanding of your document, the data model and so.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Apr 2011 10:45:00 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2011-04-19T10:45:00Z</dc:date>
    <item>
      <title>Suggest Set Analysis for 'IF Statement'</title>
      <link>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219604#M500009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;Can some one help me out to write the Set Analysis for the below three IF Statement as the performance of the chart is poor because of this. If not for all the 3 whatever is known please let me know that atleast.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt; SUM(IF(StartDate&amp;lt;=date AND EndDate&amp;gt;=date,1))&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;if(only(weekday(date))='Sat' or only(weekday(date))='Sun',darkgray(),&lt;BR /&gt;IF(A1='Change1' ,lightgray(),&lt;BR /&gt;IF(A1='Change2',lightred(),&lt;BR /&gt;IF(A1='Change3',yellow(),&lt;BR /&gt;IF(A1='Change4',lightmagenta(),&lt;BR /&gt;IF(A1='Change5',lightcyan(),&lt;BR /&gt;IF(A1='Change6',lightblue(),&lt;BR /&gt;green())))))))&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;and also for this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;=if(weekday(date) ='Sat' or weekday(date) ='Sun',darkgray())&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Apr 2011 18:39:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219604#M500009</guid>
      <dc:creator />
      <dc:date>2011-04-17T18:39:25Z</dc:date>
    </item>
    <item>
      <title>Suggest Set Analysis for 'IF Statement'</title>
      <link>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219605#M500010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Your first expression, assuming StartDate and EndDate are fields and "date" a variable should work as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;SUM({&amp;lt; StartDate = {'&amp;lt;=$(=Date(date))'}, EndDate {'&amp;gt;=$(=Date(date))'} &amp;gt;} 1)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;The second one is a pure conditional not an aggregation, so it won't work with set analysis. Rather I'd move that condition to the script, and take the value of that field in the color condition. Provided you have a calendar table linked to your fact table, a mapping table should do the trick. And the same for the third, you can always get your weekday in the script, assign the color as value of the field and use it in the chart.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Apr 2011 19:54:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219605#M500010</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-04-17T19:54:09Z</dc:date>
    </item>
    <item>
      <title>Suggest Set Analysis for 'IF Statement'</title>
      <link>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219606#M500011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Miguel Angel Baeyens wrote:&lt;BR /&gt;Your first expression, assuming StartDate and EndDate are fields and "date" a variable should work as &amp;lt;blockquote&amp;gt;SUM({&amp;lt; StartDate = {'&amp;lt;=$(=Date(date))'}, EndDate {'&amp;gt;=$(=Date(date))'} &amp;gt;} 1) &amp;lt;/blockquote&amp;gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I tried the above one but it is not working as expected. May be becuase of the wrong assumption! As per your assumption "date" is not a variable it is field. Can you please do the required changes in the above set analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2011 07:15:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219606#M500011</guid>
      <dc:creator />
      <dc:date>2011-04-18T07:15:49Z</dc:date>
    </item>
    <item>
      <title>Suggest Set Analysis for 'IF Statement'</title>
      <link>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219607#M500012</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;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;SUM({&amp;lt; date = {'&amp;gt;=$(=Date(EndDate))&amp;lt;=$(=Date(StartDate))'} &amp;gt;} 1)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2011 18:15:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219607#M500012</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-04-18T18:15:05Z</dc:date>
    </item>
    <item>
      <title>Suggest Set Analysis for 'IF Statement'</title>
      <link>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219608#M500013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Miguel Angel Baeyens wrote:&lt;BR /&gt;SUM({&amp;lt; date = {'&amp;gt;=$(=Date(EndDate))&amp;lt;=$(=Date(StartDate))'} &amp;gt;} 1) &amp;lt;pre&amp;gt;&lt;/PRE&gt;&lt;DIV style="CLEAR:both;"&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Sorry! Above Set Analysis is not working as expected. The reason why I was trying to replace the 'IF Statement' was to improve the performance. But unfortunately after using the Set Analysis performance is much poor and also it is not working as expected.&lt;/P&gt;&lt;P&gt;Thanks for your effort and time. If you get to know any other solution please do let me know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 07:51:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219608#M500013</guid>
      <dc:creator />
      <dc:date>2011-04-19T07:51:44Z</dc:date>
    </item>
    <item>
      <title>Suggest Set Analysis for 'IF Statement'</title>
      <link>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219609#M500014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It's difficult to me to understand how set analysis performs poorer than an If() expression, anyway not knowing the datamodel, I think that everything is possible.&lt;/P&gt;&lt;P&gt;But if it's not working as expected, there's likely an issue with date formatting or data modelling, because the expression above is the tipical example when selecting a date between a range of dates.&lt;/P&gt;&lt;P&gt;I don't dare to go any further without a better understanding of your document, the data model and so.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 10:45:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219609#M500014</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-04-19T10:45:00Z</dc:date>
    </item>
    <item>
      <title>Suggest Set Analysis for 'IF Statement'</title>
      <link>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219610#M500015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel&lt;/P&gt;&lt;P&gt;I was also bit surprised to see the performance of chart after using the Set Analysis. I also agree with that it is not easy to proceed further with knowing the date formatting and data modelling.&lt;/P&gt;&lt;P&gt;Consider the application which is there in the below link as sample application. This is sample of the application which I am working on.&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/forums/t/44440.aspx"&gt;http://community.qlik.com/forums/t/44440.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope you can go further now! If you get any solution please do let me know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 11:08:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219610#M500015</guid>
      <dc:creator />
      <dc:date>2011-04-19T11:08:06Z</dc:date>
    </item>
    <item>
      <title>Suggest Set Analysis for 'IF Statement'</title>
      <link>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219611#M500016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel&lt;/P&gt;&lt;P&gt;To know the reason why it is not working. Requesting you to use your Set Analysis in the expression of the chart. You will be see the difference in chart and also you will see the performance.&lt;/P&gt;&lt;P&gt;If you have any doubt please do let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 11:39:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219611#M500016</guid>
      <dc:creator />
      <dc:date>2011-04-19T11:39:58Z</dc:date>
    </item>
    <item>
      <title>Suggest Set Analysis for 'IF Statement'</title>
      <link>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219612#M500017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Yep, both tables are isolated, so any calculation will take a lot of time since it needs to compare very value in table "Calendar" for every value in table "Data". You should associate both tables through a common field. Since you have a calendar that calendar is likely to work on some of the dates you have (StartDate, EndDate -that, by the way, are not variables, but fields, that was misleading me). Besides, your calendar seems to have lots of repeated values (16K+ rows) which is likely an error (probably some unwanted concatenation or joining).&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 14:00:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219612#M500017</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-04-19T14:00:26Z</dc:date>
    </item>
    <item>
      <title>Suggest Set Analysis for 'IF Statement'</title>
      <link>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219613#M500018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel&lt;/P&gt;&lt;P&gt;Still I couldn't proceed further. If you don't mind can you please give me some other suggestion to proceed further. Imagine this is how the data is. Also I don't the logic behind the 'IF Statement'! I got the code some where from the forum and it is working as expected. So I don't know what changes are required.&lt;/P&gt;&lt;P&gt;Hope you can understand!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2011 13:19:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Suggest-Set-Analysis-for-IF-Statement/m-p/219613#M500018</guid>
      <dc:creator />
      <dc:date>2011-04-28T13:19:54Z</dc:date>
    </item>
  </channel>
</rss>

