<?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: using if condition for aggr result in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/using-if-condition-for-aggr-result/m-p/2499498#M1226335</link>
    <description>&lt;P&gt;Hi, try setting a table with&amp;nbsp;store_code as dimension and that expression, check wich&amp;nbsp;store_code are not counted as expected and that may give you a hint of what's happeing, if not, try posting the unwanted result so we can guess what's happening.&lt;/P&gt;
&lt;P&gt;So far I would try removing the spaces in the date condition and using double quotes instead of single quotes.&lt;/P&gt;
&lt;P&gt;Also setting the set analysis in the external count, it shouldn't have any impact in this expression, but I usually set the condtions to filter in both to reduce the data the process.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count(DISTINCT {&amp;lt;operation_date={"&amp;gt;=$(=vMaxTday)&amp;lt;=$(=vToday)"}&amp;gt;}
Aggr(
If(Sum({&amp;lt;operation_date={"&amp;gt;=$(=vMaxTday)&amp;lt;=$(=vToday)"}&amp;gt;} total_stock) &amp;gt; 0, store_code),
store_code ))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;In expression editor you can also check that the variables are beign converted to the expected date values, I would also try to set fixed dates to confirm the date format that works with operation_date&lt;/P&gt;</description>
    <pubDate>Sat, 28 Dec 2024 07:41:31 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2024-12-28T07:41:31Z</dc:date>
    <item>
      <title>using if condition for aggr result</title>
      <link>https://community.qlik.com/t5/QlikView/using-if-condition-for-aggr-result/m-p/2499476#M1226334</link>
      <description>&lt;P&gt;I would like to calculate the number of stores with stock. Here is the expression I have used so far, but it does not give the expected result:&lt;/P&gt;
&lt;PRE&gt;Count(DISTINCT &lt;BR /&gt;Aggr(&lt;BR /&gt;If(Sum({&amp;lt;operation_date= {'&amp;gt;=$(=vMaxTday) &amp;lt;=$(=vToday)'}&amp;gt;} total_stock) &amp;gt; 0, store_code),&lt;BR /&gt;store_code ))&lt;/PRE&gt;
&lt;P&gt;vMaxTday and vToday are variables that define a date range from '2024-01-01' to today's date.&lt;/P&gt;
&lt;P&gt;I am using this expression in a pivot table, and the table structure is as follows:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%"&gt;item_code&lt;/TD&gt;
&lt;TD width="20%"&gt;item_color&lt;/TD&gt;
&lt;TD width="20%"&gt;itemdim1&lt;/TD&gt;
&lt;TD width="20%"&gt;sales&lt;/TD&gt;
&lt;TD width="20%"&gt;returns&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 27 Dec 2024 17:07:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-if-condition-for-aggr-result/m-p/2499476#M1226334</guid>
      <dc:creator>muratmert41</dc:creator>
      <dc:date>2024-12-27T17:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: using if condition for aggr result</title>
      <link>https://community.qlik.com/t5/QlikView/using-if-condition-for-aggr-result/m-p/2499498#M1226335</link>
      <description>&lt;P&gt;Hi, try setting a table with&amp;nbsp;store_code as dimension and that expression, check wich&amp;nbsp;store_code are not counted as expected and that may give you a hint of what's happeing, if not, try posting the unwanted result so we can guess what's happening.&lt;/P&gt;
&lt;P&gt;So far I would try removing the spaces in the date condition and using double quotes instead of single quotes.&lt;/P&gt;
&lt;P&gt;Also setting the set analysis in the external count, it shouldn't have any impact in this expression, but I usually set the condtions to filter in both to reduce the data the process.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count(DISTINCT {&amp;lt;operation_date={"&amp;gt;=$(=vMaxTday)&amp;lt;=$(=vToday)"}&amp;gt;}
Aggr(
If(Sum({&amp;lt;operation_date={"&amp;gt;=$(=vMaxTday)&amp;lt;=$(=vToday)"}&amp;gt;} total_stock) &amp;gt; 0, store_code),
store_code ))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;In expression editor you can also check that the variables are beign converted to the expected date values, I would also try to set fixed dates to confirm the date format that works with operation_date&lt;/P&gt;</description>
      <pubDate>Sat, 28 Dec 2024 07:41:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-if-condition-for-aggr-result/m-p/2499498#M1226335</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2024-12-28T07:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: using if condition for aggr result</title>
      <link>https://community.qlik.com/t5/QlikView/using-if-condition-for-aggr-result/m-p/2499517#M1226336</link>
      <description>&lt;P&gt;Count(&lt;BR /&gt;DISTINCT Aggr(&lt;BR /&gt;If(Sum({&amp;lt;operation_date={'&amp;gt;=$(=vMaxTday)&amp;lt;=$(=vToday)'}&amp;gt;} total_stock) &amp;gt; 0, store_code),&lt;BR /&gt;store_code&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Sun, 29 Dec 2024 09:12:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-if-condition-for-aggr-result/m-p/2499517#M1226336</guid>
      <dc:creator>diegozecchini</dc:creator>
      <dc:date>2024-12-29T09:12:47Z</dc:date>
    </item>
  </channel>
</rss>

