<?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 Why need to aggregate a double IF-statement for variable in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Why-need-to-aggregate-a-double-IF-statement-for-variable/m-p/1724200#M55112</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm using a variable in a button to switch a dynamic table.&lt;/P&gt;&lt;P&gt;I have Order Id's which have Status K and others have the Status V:&lt;/P&gt;&lt;TABLE width="248px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="81px" height="47px"&gt;er&lt;/TD&gt;&lt;TD width="83px" height="47px"&gt;Status&lt;/TD&gt;&lt;TD width="83px" height="47px"&gt;Startdate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="81px" height="25px"&gt;111111&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;K&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;18.06.2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="81px" height="25px"&gt;222222&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;V&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;19.06.2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="81px" height="25px"&gt;333333&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;V&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;22.06.2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="81px" height="25px"&gt;444444&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;K&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;24.06.2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The formula for the dimension startdate.autocalendar.date is like following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(If(vVariable='0',count({&amp;lt;Status={"K"}&amp;gt;]Orders),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;count({&amp;lt;Status={"V"}&amp;gt;]Orders)))&amp;gt;0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;StartingDate.autocalendar.date))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So practically it means if the button switch is set to variable '0', count orders with K otherwise count orders with V and in either option, the value needs to be greater than 0, then it should return me the dimension startingDate.&amp;nbsp; I'm wondering why I get no returns.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Only with aggr I get the switch between these working:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;aggr(if(If(vVariable='0',count(distinct Orders),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;count(distinct Orders2))&amp;gt;0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;StartingDate.autocalendar.date)),StartingDate.autocalendar.date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone explain to me why I need to aggr and put another StartingDate to the end? For me the first function was fine, its practically the same as the following single if-statement&amp;nbsp; function simplified, just that it has no variable and no Status K and V filter:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(Order&amp;gt;0,StartingDate,0)&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Of course this one has no Status K,V filter and no variables. But it returns me every StartingDate for EVERY row, as long there is a OrderId given.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jul 2020 18:34:35 GMT</pubDate>
    <dc:creator>Applicable88</dc:creator>
    <dc:date>2020-07-01T18:34:35Z</dc:date>
    <item>
      <title>Why need to aggregate a double IF-statement for variable</title>
      <link>https://community.qlik.com/t5/App-Development/Why-need-to-aggregate-a-double-IF-statement-for-variable/m-p/1724200#M55112</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm using a variable in a button to switch a dynamic table.&lt;/P&gt;&lt;P&gt;I have Order Id's which have Status K and others have the Status V:&lt;/P&gt;&lt;TABLE width="248px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="81px" height="47px"&gt;er&lt;/TD&gt;&lt;TD width="83px" height="47px"&gt;Status&lt;/TD&gt;&lt;TD width="83px" height="47px"&gt;Startdate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="81px" height="25px"&gt;111111&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;K&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;18.06.2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="81px" height="25px"&gt;222222&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;V&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;19.06.2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="81px" height="25px"&gt;333333&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;V&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;22.06.2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="81px" height="25px"&gt;444444&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;K&lt;/TD&gt;&lt;TD width="83px" height="25px"&gt;24.06.2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The formula for the dimension startdate.autocalendar.date is like following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(If(vVariable='0',count({&amp;lt;Status={"K"}&amp;gt;]Orders),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;count({&amp;lt;Status={"V"}&amp;gt;]Orders)))&amp;gt;0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;StartingDate.autocalendar.date))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So practically it means if the button switch is set to variable '0', count orders with K otherwise count orders with V and in either option, the value needs to be greater than 0, then it should return me the dimension startingDate.&amp;nbsp; I'm wondering why I get no returns.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Only with aggr I get the switch between these working:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;aggr(if(If(vVariable='0',count(distinct Orders),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;count(distinct Orders2))&amp;gt;0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;StartingDate.autocalendar.date)),StartingDate.autocalendar.date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone explain to me why I need to aggr and put another StartingDate to the end? For me the first function was fine, its practically the same as the following single if-statement&amp;nbsp; function simplified, just that it has no variable and no Status K and V filter:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(Order&amp;gt;0,StartingDate,0)&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Of course this one has no Status K,V filter and no variables. But it returns me every StartingDate for EVERY row, as long there is a OrderId given.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 18:34:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Why-need-to-aggregate-a-double-IF-statement-for-variable/m-p/1724200#M55112</guid>
      <dc:creator>Applicable88</dc:creator>
      <dc:date>2020-07-01T18:34:35Z</dc:date>
    </item>
  </channel>
</rss>

