<?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 If statement with where clause in expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1649452#M731906</link>
    <description>&lt;P&gt;Good day Community&lt;/P&gt;&lt;P&gt;I have an expression below, which works perfectly.&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#993300"&gt;=IF(Num(Sum({&amp;lt;$(eSetFYTD_CN)&amp;gt;}Amount) / $(ThouMenu),'# ##0')&amp;lt; 0 , '100%-')&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;So I want to add an additional condition where the&amp;nbsp; Dim Category = Costs , for&amp;nbsp; example. How do I then refine the expression to include the condition?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;P&gt;Matlotlo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>nkosinde13</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>If statement with where clause in expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1649452#M731906</link>
      <description>&lt;P&gt;Good day Community&lt;/P&gt;&lt;P&gt;I have an expression below, which works perfectly.&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#993300"&gt;=IF(Num(Sum({&amp;lt;$(eSetFYTD_CN)&amp;gt;}Amount) / $(ThouMenu),'# ##0')&amp;lt; 0 , '100%-')&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;So I want to add an additional condition where the&amp;nbsp; Dim Category = Costs , for&amp;nbsp; example. How do I then refine the expression to include the condition?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;P&gt;Matlotlo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1649452#M731906</guid>
      <dc:creator>nkosinde13</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with where clause in expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1649457#M731907</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;you have two options :&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. use if statement&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;=IF(Num(Sum({&amp;lt;$(eSetFYTD_CN)&amp;nbsp;&amp;gt;}if(Dim Category = Costs,Amount)) / $(ThouMenu),'# ##0')&amp;lt; 0 , '100%-')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; pros :&lt;BR /&gt;&amp;nbsp; &amp;nbsp; this expression is completely effected from selections made in the app&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; cons:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; performance wise it's might work slower than solution 2 as it been&amp;nbsp;&lt;/SPAN&gt;evaluated&lt;SPAN&gt;&amp;nbsp; for each row&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. use set analysis&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;=IF(Num(Sum({&amp;lt;$(eSetFYTD_CN),Dim Category = {"Costs"}&amp;gt;}Amount) / $(ThouMenu),'# ##0')&amp;lt; 0 , '100%-')&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;pros:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; performance will be better as it's replicate a selection at model level&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;cons :&lt;BR /&gt;&amp;nbsp; &amp;nbsp; selection made in the dim category field won't effect the calculation and might confuse the user&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 08:30:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1649457#M731907</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2019-11-21T08:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with where clause in expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1649475#M731908</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6330"&gt;@lironbaram&lt;/a&gt;&amp;nbsp; Thank you very much for your quick assistance. The set analysis option is perfect. I do not want it to be affected by any selection since I';m just assigning '100%-' to all values that meet the conditions in a table chart. Meaning if the calculation results in&amp;nbsp; a negative value it should assign the&amp;nbsp;100%-' but only if the category is a cost since I have both revenue and costs in the Category,I'm using this on a field where I'm calculating % change.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Matlotlo&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 08:55:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1649475#M731908</guid>
      <dc:creator>nkosinde13</dc:creator>
      <dc:date>2019-11-21T08:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with where clause in expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1649487#M731909</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6330"&gt;@lironbaram&lt;/a&gt;&amp;nbsp; I just realised that&amp;nbsp; I did not phrase my question correctly:&lt;/P&gt;&lt;P&gt;This is I basically&amp;nbsp; what I wanted:&lt;/P&gt;&lt;P&gt;Num(Sum({&amp;lt;$(eSetFYTD_CN)&amp;gt;}Amount) / $(ThouMenu),'# ##0')&amp;lt; 0&amp;nbsp; AND&amp;nbsp; &lt;SPAN&gt;Dim Category = 'Costs'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This is because I did not want to filter the results on category but just to assign to the values with Costs as category&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Matlotlo&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 09:22:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1649487#M731909</guid>
      <dc:creator>nkosinde13</dc:creator>
      <dc:date>2019-11-21T09:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with where clause in expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1654341#M731910</link>
      <description>&lt;P&gt;Have a look at the following Design Blog post, I think it may be of some help on this one:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 21:14:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1654341#M731910</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-12-04T21:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with where clause in expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1655007#M731911</link>
      <description>&lt;P&gt;Thank you so much for this &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/14114"&gt;@Brett_Bleess&lt;/a&gt;&amp;nbsp;, it really is helpful. I now have&amp;nbsp; a better understanding of aggregate function.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 13:11:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-where-clause-in-expression/m-p/1655007#M731911</guid>
      <dc:creator>nkosinde13</dc:creator>
      <dc:date>2019-12-06T13:11:40Z</dc:date>
    </item>
  </channel>
</rss>

