<?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: If statement with a group by ??? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/If-statement-with-a-group-by/m-p/1611187#M45440</link>
    <description>&lt;P&gt;You need to use at least one aggregation function (Sum, count, etc.) to be able to group values (otherwise, Qlik won't know how to combine the values in order to group them).&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD * INLINE&lt;BR /&gt;[Project,Invoice,outstanding amount,&lt;BR /&gt;Project1,abc,65000&lt;BR /&gt;Project1,def,0&lt;BR /&gt;Project2,ghi,0];&lt;/P&gt;&lt;P&gt;Final:&lt;BR /&gt;LOAD&lt;BR /&gt;Project,&lt;BR /&gt;If(Sum([outstanding amount])&amp;gt;0, 'Yes', 'No') as OutstandingFlag&lt;BR /&gt;Resident Data&lt;BR /&gt;Group By Project;&lt;/P&gt;&lt;P&gt;Drop table Data;&lt;/P&gt;&lt;P&gt;Note that if your [outstanding values]&amp;nbsp; field can have negative values, these could cancel out the positive values. If you don't want this to happen, you'll have to change the formula a little bit (for example, add an if to the sum to only sum positive values). If that's the case and you need any help with that, let me know.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Aug 2019 15:04:35 GMT</pubDate>
    <dc:creator>jensmunnichs</dc:creator>
    <dc:date>2019-08-09T15:04:35Z</dc:date>
    <item>
      <title>If statement with a group by ???</title>
      <link>https://community.qlik.com/t5/App-Development/If-statement-with-a-group-by/m-p/1611169#M45433</link>
      <description>&lt;P&gt;This should be really basic, but i can't seem to figure it out&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have Projects , Projects then have invoices, invoices then have outstanding amounts. All have their own fields&lt;/P&gt;&lt;P&gt;[Project,Invoice,outstanding amount,&lt;/P&gt;&lt;P&gt;Project1,abc,65000&lt;/P&gt;&lt;P&gt;Project1,def,0&lt;/P&gt;&lt;P&gt;Project2,ghi,0]&lt;/P&gt;&lt;P&gt;How can I write an If statement to tell me whether a Project has an outstanding amount. Because when I write basics like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If(Len(outstanding_amount)&amp;gt;2,'YES','NO') AS XYZ&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works but does it per invoice, not rolled up to a project level.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 05:01:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-statement-with-a-group-by/m-p/1611169#M45433</guid>
      <dc:creator>mikegauntlett</dc:creator>
      <dc:date>2024-11-16T05:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with a group by ???</title>
      <link>https://community.qlik.com/t5/App-Development/If-statement-with-a-group-by/m-p/1611184#M45438</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table:
LOAD * INLINE [
    Project, Invoice, outstanding amount
    Project1, abc, 65000
    Project1, def, 0
    Project2, ghi, 0
];

Left Join (Table)
LOAD Project,
	 If(Sum([outstanding amount]) &amp;gt; 0, 'YES', 'NO') as XYZ
Resident Table
Group By Project;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Aug 2019 15:00:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-statement-with-a-group-by/m-p/1611184#M45438</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-08-09T15:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with a group by ???</title>
      <link>https://community.qlik.com/t5/App-Development/If-statement-with-a-group-by/m-p/1611187#M45440</link>
      <description>&lt;P&gt;You need to use at least one aggregation function (Sum, count, etc.) to be able to group values (otherwise, Qlik won't know how to combine the values in order to group them).&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD * INLINE&lt;BR /&gt;[Project,Invoice,outstanding amount,&lt;BR /&gt;Project1,abc,65000&lt;BR /&gt;Project1,def,0&lt;BR /&gt;Project2,ghi,0];&lt;/P&gt;&lt;P&gt;Final:&lt;BR /&gt;LOAD&lt;BR /&gt;Project,&lt;BR /&gt;If(Sum([outstanding amount])&amp;gt;0, 'Yes', 'No') as OutstandingFlag&lt;BR /&gt;Resident Data&lt;BR /&gt;Group By Project;&lt;/P&gt;&lt;P&gt;Drop table Data;&lt;/P&gt;&lt;P&gt;Note that if your [outstanding values]&amp;nbsp; field can have negative values, these could cancel out the positive values. If you don't want this to happen, you'll have to change the formula a little bit (for example, add an if to the sum to only sum positive values). If that's the case and you need any help with that, let me know.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 15:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-statement-with-a-group-by/m-p/1611187#M45440</guid>
      <dc:creator>jensmunnichs</dc:creator>
      <dc:date>2019-08-09T15:04:35Z</dc:date>
    </item>
  </channel>
</rss>

